MVC路径无匹配或请求api版本过低时处理

解决方案:RequestMappingHandlerMapping中重写handleNoMatch方法,springMVC和springboot中配置无区别。

另:

1、可搭配advice处理抛出的异常;

2、可在HttpServletRequest中通过setAttribute、getAttribute记录/读取状态。

 

posted on 2018-07-31 12:51  kurama2018  阅读(216)  评论(0编辑  收藏  举报