I want to fetch url parameter in my class. my application based on Spring MVC.
While calling url: http://localhost:8080/mywebapp/dir/register.do?id=26 it gives error 400
@RequestMapping(value = "/register")
public ModelAndView finalPage(@PathVariable("id") Long id) throws NumberFormatException, Exception {
// code...
}
Anybody can solve my problem.
@PathVariableworks and why?@QueryParaminstead of@PathVariable