My main problem here is returning a string with a pathvariable value from one controller to another.
See here:
@RequestMapping(value = "/profile/{location}")
public ModelAndView profile(@PathVariable("location") String location) throws Exception {
return new ModelAndView("profile", "*", *);
}
@RequestMapping(value = "/records", method = "RequestMethod.POST")
public String inRecords(@Valid User user, BindingResult result) {
if(result.hasErrors()) {
return "profile/system";
}
else {
.....
return "somewhere";
}
}
My problem here is the return "profile/system" going to WEB-INF/views/profile/system.jsp. Am I doing anything wrong with @PathVariable or with the return statement itself?
Any suggestions?
BindingResultorRedirectAttributes, so I can't help you.