Spring参考手册 mvc:resources 分类:
来源:互联网 发布:vmware mac os 联网 编辑:程序博客网 时间:2024/06/05 19:46
<mvc:resources mapping="/resources/**" location="/public-resources/"/>
设置一年的缓存时间以最大化的利用浏览器缓存和减少服务器压力:
<mvc:resources mapping="/resources/**" location="/public-resources/" cache-period="31556926"/>
<mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/public-web-resources/"/>
使用util:properties标签把properties文件的内容提供给SpEL
<util:properties id="applicationProps" location="/WEB-INF/spring/application.properties"/>
通过SpEL得到应用的版本,可以把他加入到用到的resources标签:
<mvc:resources mapping="/resources-#{applicationProps['application.version']}/**" location="/public-resources/">
最后,可以使用spring jsp标签表示请求资源的url:
<spring:eval expression="@applicationProps['application.version']" var="applicationVersion"/>
<spring:url value="/resources-{applicationVersion}" var="resourceUrl">
<spring:param name="applicationVersion" value="${applicationVersion}"/>
</spring:url>
<script src="${resourceUrl}/dojo/dojo.js" type="text/javascript"> </script>
- Spring参考手册 mvc:resources 分类:
- Spring参考手册 mvc:resources
- Spring参考手册 mvc:interceptors
- Spring参考手册 mvc:interceptors
- Spring mvc <mvc:resources ***/> 作用
- Spring参考手册 mvc:annotation-driven
- Spring参考手册 mvc:view-controller
- Spring参考手册 mvc:default-servlet-handler
- Spring mvc <mvc:resources /> 和<mvc:default-servlet-handler />
- Spring : 使用<mvc:resources 访问静态资源
- 关于spring <mvc:resources> 标签的使用
- spring mvc:resources 静态资源访问
- 【Java.Spring.MVC】Spring使用示例参考手册;MVC注解参考
- SPRING MVC 配置<MVC:RESOURCES/> 导致@CONTROLLER失效
- 关于spring-mvc.xml的mvc:resources元素浅析。
- spring mvc中<mvc:resources> 标签的使用
- Spring MVC 静态资源访问 mvc:resources 标签
- <mvc:resources>
- 关于Jmail不能发送邮件问题
- linux文件系统的系统分析--(五)路径名的查找
- 如何在Android模拟器下添加busybox(图文)
- Java程序员从笨鸟到菜鸟之(二十六)XML之DOM和SAX解析
- 【zz】实现一棵多叉树
- Spring参考手册 mvc:resources 分类:
- 页眉、页脚及页码的设置(fancyhdr宏包的使用)
- 黑马程序员-Ajax原理
- VS2008 读写大文件
- Architecture & Connection
- hdu 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包)
- CAP & MAP & VLR & HLR & GMSC & DP & gsmSSF简介
- Servlet入门
- android STK(二)--转载