春のMVCに関するチュートリアルを読んだときに問題が発生しました。プロジェクトには次のようなjspページがあります。
<html>
<head>
<title>Spring 3.0 MVC Series: Hello World - ViralPatel.net</title>
</head>
<body>
hello!
${inf}
</body>
</html>
そして、コントローラーでinfに値を設定すると、「${inf}」は値を取得できません。
私は今どうすればいい?
どうも
追加:コントローラーのコード:
package net.viralpatel.spring3.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.portlet.ModelAndView;
@Controller
public class HelloWorldController {
@RequestMapping("hello")
public ModelAndView helloWorld() {
String message = "Hello World, Spring 3.0!";
System.out.println(message);
ModelAndView modelandview=new ModelAndView("hello");
modelandview.addObject("inf", message);
//return new ModelAndView("hello", "message", message);
return modelandview;
}
}