「Kotlin入門」@Controllerアノテーションのサンプル

構文
@Controller
class クラス名
サンプルコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import org.springframework.ui.set
@Controller
class UserController {
@GetMapping("/user")
fun handle(model: Model): String {
model["message"] = "this is a test user"
return "index"
}
}
import org.springframework.ui.set @Controller class UserController { @GetMapping("/user") fun handle(model: Model): String { model["message"] = "this is a test user" return "index" } }
import org.springframework.ui.set

@Controller
class UserController {

    @GetMapping("/user")
    fun handle(model: Model): String {
        model["message"] = "this is a test user"
        return "index"
    }
}

 

Kotlin

Posted by arkgame