I create Spring MVC project like this. This is Controller:
@Controller
public class HelloWorldController {
@RequestMapping("/hello")
public String doHello(Model model) {
model.addAttribute("message", "Hello Spring MVC");
return "helloworld";
}
}
And this is content of file "helloworld.jsp".
<body> <h1>${message }</h1> </body> // I don't know why I can't post full code
When i run URL "http://localhost:8080/HelloSpringMVC/hello", the result should be Hello Spring MVC but I got ${message }, what's going on?
Make sure you have javax expression language dependency in your project.