设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

Spring Framework 4.1 RC发布,静态资源处理

2014-7-25 09:49| 发布者: joejoe0332| 查看: 2166| 评论: 0|原作者: oschina|来自: oschina

摘要:   本周Spring Framework 4.1 RC版本发布了,现在是测试该版本新特性最好的时间,看看到底这个版本能给你的应用带来多少改进。新特性之一便是灵活的解析和转换静态 Web 资源,你可以使用 ResourceHttpRequestHandle ...

  本周 Spring Framework 4.1 RC 版本发布了,现在是测试该版本新特性最好的时间,看看到底这个版本能给你的应用带来多少改进。新特性之一便是灵活的解析和转换静态 Web 资源,你可以使用 ResourceHttpRequestHandlers 来处理静态资源。


  静态资源处理的流程如下:


1
2
3
4
5
6
7
8
9
10
  Resource link in a template source file
      |
      | Resource path (like "/css/main.css")
      v 
  Resolvers chain: FirstResolver, SecondResolver, ThirdResolver
  (each resolver can modify the resource path or delegate to the next one)
      |
      | Updated resource path (like "/css/main-0e37f12.css")
      v 
  Resource link in a rendered template


  新的推荐的项目文件布局:


1
2
3
4
5
6
7
8
9
10
11
12
13
spring-app/
|- build.gradle
|- client/
|  |- src/
|  |  |- css/
|  |  |- js/
|  |     |- main.js
|  |- test/
|  |- build.gradle
|  |- gulpfile.js
|- server/
|  |- src/main/java/
|  |– build.gradle


  应用场景:


1. 避免静态资源的缓存
2. 新的项目结构更加便于资源引用
3. 更方便的模板引擎集成
4. 完整的构建工具链


  详细介绍请看官方发行说明:
http://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部