加上mvc:resources后controller访问404

之前因为静态资源访问,404,于是加上了类似的代码

<mvc:resources location="/resources/" mapping="/resources/**"/>

运行之后发现,Controller访问404了

出现这样的问题,在mvc:resources下加上mvc:annotation-driven即可

代码如下:

<mvc:resources location="/resources/" mapping="/resources/**"/>
<mvc:annotation-driven/>


你可能感兴趣的:(spring,spring,mvc)