捕捉url不正确的小技巧:
@ExceptionHandler
@RequestMapping(value = "/**")
public ModelAndView noHandlerMappingFound() throws HandlerNotFoundException {
throw new HandlerNotFoundException("No handler mapping found.");
}
这样所有不符合格式的url都会进入以上的方法
参考: http://stackoverflow.com/questions/3802012/catch-spring-mvc-no-mapping-error