spring 3 mvc requestmapping dynamic param problem
- by Faisal khan
I have the following code which works fine with
http://localhost:8080/HelloWorldSpring3/forms/helloworld
but i want to have url have some thing like this
http://localhost:8080/HelloWorldSpring3/forms/helloworld/locname_here/locid_here
I found that adding this @RequestMapping("/helloworld/**") will work but when i try to access
http://localhost:8080/HelloWorldSpring3/forms/helloworld/locname_here/locid_here
it is not found.
Web.xml entry as follows
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/forms/*</url-pattern>
</servlet-mapping>
Mapping bean entry
@RequestMapping("/helloworld/**")
public ModelAndView helloWord(){
String message = "Hello World, Spring 3.0!";
return new ModelAndView("helloworld", "message",message);
}