Can you give me a brief explanation and a sample in using @PathVariable in spring mvc? Please include on how you type the url?
I\'m struggling in getting th
Have a look at the below code snippet.
@RequestMapping(value="/Add/{type}")
public ModelAndView addForm(@PathVariable String type ){
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("addContent");
modelAndView.addObject("typelist",contentPropertyDAO.getType() );
modelAndView.addObject("property",contentPropertyDAO.get(type,0) );
return modelAndView;
}
Hope it helps in constructing your code.