I'm trying to handle a HTTP Status Error 400. I think that this occurs due to a type mismatch.
So e.g.
http://localhost:8080/app/info.htm?id=123
works while
http://localhost:8080/app/info.htm?id=abc
doesn't.
@RequestMapping(value = "/info", method = RequestMethod.GET, params = "id")
public String getInfo(@RequestParam("id") Integer id, Model model) {
// get info object via service and show it
// model.addAttribute("infoObj", infoObj);
return "info";
}
Is there a way to handle this and return e.g. the page index.jsp
if this error occurs?
答案 0 :(得分:1)