iam using a very basic basic basic controller in spring mvc
...
@RequestMapping("/welcome")
public ModelAndView helloWorld() {
String message = "Hello World, Spring 3.0!";
return new ModelAndView("helloteste", "message", message);
}
...
but when accessing it from a jsp, nothing is shown.
Jsp bellow
<html>
<head>
<title>Spring 3.0 MVC Series: Hello World </title>
</head>
<body>
${message}
</body>
</html>
Result on the screen (the server does not resolve the tag …)
${message}
However if i get te info directely from the attributes of the request, it works …
<%
String s = (String ) request.getAttribute("message");
out.print(s);
%>
Why the notation ${…} is not working ???
It seems as if the JSP is not resolving the expression language. This can be a configuration issue if your web.xml file does not specify a
versionattribute of 2.4 or greater for the<web-app/>tag. In this case, I would recommend updating your web.xml file to following, provided that your app server is modern enough: