|
Spring-MVCの散歩道 > SpringMVC の小径 > 第5歩 Spring-MVC 初めの一歩 > Hello! Spring-MVC!
|
package jp.dip.arimodoki.cntl; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller //①コントローラ宣言アノテーション public class Hello { /** * ②helloマッピングハンドラ */ @RequestMapping(value = "/hello") public String hello_view() { //メソッド名はhelloでなくてもいいです //ほんとは、ここで ごにょごにょと何らかの怪しい処理が動きます。 //③WebContent/hello.html を描画する return "hello"; } } |