1、在springmvcl配置文件中加入
2、在web.xml中配置defaultServlet
3、
<mvc:resources mapping="/images/" location="/images/" />
<mvc:resources mapping="/css/" location="/css/" />
<mvc:resources mapping="/js/**" location="/js/" />
推荐使用第二种方法,不会进DispatcherServlet效率更高。