0
假设我有一个控制器:配置错误页面
@Controller
public class SomeController {
@RequestMapping(value = "{id}/object.do")
public String showObject(@PathVariable("id") Integer id,
HttpServletRequest request) {
//do smth
return "somePage";
}
}
当“ID”是不是一个数字,但字符串如“AAA/object.do”雄猫告诉我一个错误 - “客户端发送的请求在语法上不正确。“
有没有办法配置一个错误页面,只有当“ID”路径变量具有不正确的类型时才会显示?