在jsp引入js失败,提示404

在jsp引入js失败,提示404找不到该文件,

为什么呢?后来想起我使用的是springmvc,在配置的时候可能会影响到静态文件的使用,如js、css。

解决方法:

在springMvc配置文件springMVC-servlet.xml中加入

<mvc:annotation-driven/>

<mvc:default-servlet-handler/>

就可以了。

原文地址:https://www.cnblogs.com/guohu/p/14138256.html