SpringMVCで非常に基本的な基本的な基本コントローラーを使用するiam
...
@RequestMapping("/welcome")
public ModelAndView helloWorld() {
String message = "Hello World, Spring 3.0!";
return new ModelAndView("helloteste", "message", message);
}
...
ただし、jspからアクセスする場合は、何も表示されません。Jspベローズ
<html>
<head>
<title>Spring 3.0 MVC Series: Hello World </title>
</head>
<body>
${message}
</body>
</html>
画面に表示される結果(サーバーはタグを解決しません...)
${message}
ただし、リクエストの属性から直接情報を取得すると、機能します...
<%
String s = (String ) request.getAttribute("message");
out.print(s);
%>
表記${...}が機能しないのはなぜですか?