springMVC简易框架学习(二)
(一)https://blog.csdn.net/qq_36760873/article/details/100037527
3.SpringMVC访问静态资源问题
1.修改web.xml中的访问路径
SpringMVC
*.do
在bean标签中修改:
访问:
localhost:8080/20181105_SpringMVC03_Resource/hello.do?method=add
2.修改web.xml中的映射
default
.jpg
.css
*.js
3.配置MVC静态资源标签(建议使用)
<mvc:resources location="/resource/" mapping="/resource/**"/>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans.xml</param-value>
</init-param>
SpringMVC /
持续更新,一起加油!