Spring 4.0 - How to pass a variable after fore slash
by C-an
When it has just one parameter.
@RequestMapping(value = "/.../{userId}", method=RequestMethod.GET)
public ModelAndView myprofilePage(..., @PathVariable String userId) {
...
return mv;
}
When it has more than one parameter.
@RequestMapping(value = "/.../{userId}/{pageNum}", method=RequestMethod.GET)
public ModelAndView myprofilePage(..., @PathVariable String userId, @PathVariable long pageNum) {
...
return mv;
}
Subscribe via RSS