Introduction
ionSpring makes it easy to create web application for IBM i platform.
This is not a new framework but rather an opinionated and very light preconfiguration of existing frameworks and some small adapters for IBM i.
Open source under Apache Software License 2.0
The following frameworks/libraries are used:
- Spring Boot: the leading Java application framework
- Vaadin Flow: A Java web framework
- Karibu-DSL: Kotlin extensions and DSL library for Vaadin Flow
Getting started
- Create a Spring Boot Project with Spring initializr
- Decompress the generated project and open it with your IDE (Intellij IDEA is recommended)
- Edit the
build.gradle.kts
file. Add the following two lines inside thedependency
block:
implementation("org.ionspring:ionspring-starter:0.1.0")
- In
src/main/kotlin
, in the package of the application, create a new Kotlin class with the following content:
package com.example.demo
import com.github.mvysny.karibudsl.v10.span
import com.github.mvysny.karibudsl.v10.textField
import com.vaadin.flow.component.html.Span
import com.vaadin.flow.component.orderedlayout.VerticalLayout
import com.vaadin.flow.data.value.ValueChangeMode
import com.vaadin.flow.router.PageTitle
import com.vaadin.flow.router.Route
@Route("")
@PageTitle("Demo home")
class HomeView : VerticalLayout() {
lateinit var span: Span
init {
textField("Your name") {
valueChangeMode = ValueChangeMode.EAGER
addValueChangeListener { e ->
if (e.value.isBlank()) {
span.text = "What's your name?"
} else {
span.text = "Hello ${e.value}"
}
}
}
span = span("What's your name?")
}
}
- Start the application from your IDE
- Open https://localhost:8080 in your browser: