java - SpringMVC 中 <mvc:resources> 标签的用途
大家讲道理
大家讲道理 2017-04-18 10:52:51
0
3
643

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
迷茫
    <!-- 对静态资源的访问,如 js, css, jpg, png -->
    <!-- 如 HTML 里访问 /js/jquery.js, 则实际访问的是 /WEB-INF/asset/js/jquery.js -->
    <mvc:resources mapping="/js/**"  location="/WEB-INF/asset/js/"  cache-period="31556926"/>
    <mvc:resources mapping="/css/**" location="/WEB-INF/asset/css/" cache-period="31556926"/>
    <mvc:resources mapping="/img/**" location="/WEB-INF/asset/img/" cache-period="31556926"/>
    <mvc:resources mapping="/lib/**" location="/WEB-INF/asset/lib/" cache-period="31556926"/>
    <mvc:resources mapping="/favicon.ico" location="/WEB-INF/asset/img/favicon.ico" cache-period="31556926"/>
刘奇

The tag in springmvc is mainly for accessing static resources. Specifically, you can download this tag on Baidu and read related blogs to learn more.

洪涛

The questioner can try to comment out this configuration code, then the resources under this path will not be accessible.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!