SlideShare a Scribd company logo
Resource Handling In Spring MVC 4.1 
Brian Clozel, Rossen Stoyanchev 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
About the presenters 
• Brian Clozel 
• Spring framework committer 
• Sagan maintainer 
• Open source enthusiast 
• Rossen Stoyanchev 
• Spring framework committer 
• Consulting and training for Spring teams 
• Java and web development since 1998 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
About the presentation 
• Web resource handling features in Spring Framework 4.1 
• Provide context and guidance 
• Design choices, questions 
• Sample code 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Resource Handling 
in Spring Framework 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Resource Handling < 4.1 
• Serve static resources from any Spring Resource location 
• classpath, file system, etc. 
• Basic cache header management 
• Expires, Cache-Control, Last-Modified 
• Easy to configure 
• MVC Java config and XML namespace 
• Or just map ResourceHttpRequestHandler 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Remaining Questions 
• Optimize (minify, concatenate, etc.) 
• Transform (sass, less, gzip) 
• Use CDN 
• Effective HTTP caching (versioned URLs) 
• Develop, debug, and refresh (F5) with ease 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Comprehensive strategy 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Spring Framework 4.1 goal 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Request for Fingerprinting URLs 
• http://jira.springsource.org/browse/SPR-10310 
• Based on “asset pipeline” from Ruby on Rails 
• Adapt feature to Spring MVC 
• build on existing resource handling mechanism 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
URL “Fingerprinting” ?! 
• Technique for effective HTTP “cache busting” 
• Version URL with hash computed from file content 
• e.g. “/css/font-awesome.min-7fbe76cdac.css” 
• Add aggressive cache headers, e.g. +1 year 
• Resource is cached in browser (until content changes) 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Full Spring MVC “Asset Pipeline” Proposal 
• Independently a proposal for complete “asset pipeline” 
• via @robertharrop (Spring Framework founder) 
• Initial investigation lead to major fork in the road 
• JavaScript build tasks offer attractive alternative 
• e.g. Grunt 
• huge ecosystem, many plugins of interest 
• works with any backend 
• Runtime vs build-time approach and trade-offs 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Yet another development 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Sagan: http://spring.io 
• Written with Spring 
• by Pivotal Labs (deep RoR knowledge) and Chris Beams 
• launched during SpringOne 2GX keynote 
• Aggressive deadline, some technical debt 
• pay-off due prior to open-sourcing 
• Improve client side 
• with help from @unscriptable and @briancavalier (cujo.js fame) 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Client Source Code Layout 
• Modern client as 1st class citizen in a Java project 
• Server and client side are each entitled to: 
• dependency management 
• modularity 
• tests 
• build artifacts (e.g. minification, concatenation) 
• Use of src/main/webapp is just not adequate any more 
• Common but behind the times 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Sagan Project Structure 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
The sagan-client module 
• Separate module 
• Lets you follow best practices 
• node.js / npm for node dependencies 
• bower: 3rd party dependency management (like Maven for Java) 
• curl, cram: module loading and concatenating 
• gulp: build tasks 
• Gradle integrated 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Working with Sagan Client Sources 
• We’re no longer using src/main/webapp 
• How to keep the same smooth, just-hit-F5, dev experience? 
• Copying files at build time, not the way to go! 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How Sagan Serves Static Resources? 
• Spring profiles (“dev”, “prod”, etc) 
• In dev mode serve directly from source location 
• i.e. 
• where saganPath is initialized from a property 
• In production from classpath (minified, concatenated) 
• JavaScript source maps for debugging in production 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Managing front-end dependencies 
• WebJars: refers to “resources bundled in a jar” 
• Sagan 
• manage client dependencies with npm and bower 
• bundle a single JAR 
• Spring Boot serves from classpath:/static 
• www.webjars.org 
• front-end dependencies as jars from Maven central 
• plus bundle client application sources (“src/main/webapp”) 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Sagan Summary 
• Production Spring application 
• Open source github.com/spring-io/sagan 
• Separate talk about Sagan: 
“Inside spring.io a production Spring reference application” 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Sample Application 
github.com/SpringOne2GX-2014/spring-resource-handling 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Demo 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Demo Summary 
• Bower downloads dependencies 
• e.g. curl 0.8.10, jquery 2.0.3, bootstrap 3.1.1, less 1.7.3 
• Gulp.js plugins 
• cram, uglify, minify-css, bower-src, pngcrush, etc. 
• Optimize .js, .css, images under src/ + copy to dist/ 
• including bower-managed sources 
• Gradle-driven 
• bundle dist under classpath:/static 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
JavaScript Build Tasks (Gulp, Grunt) 
• Tremendous choice 
• Rich ecosystem, continues to evolve 
• Sagan switched from Grunt to Gulp in its relatively short life 
• Best way to remain aligned with client trends 
• Works well with any server (Java, Ruby, etc) 
and client (JS, Dart, ES6, TypeScript) 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How can Spring MVC help? 
• Make it easy to switch between environments 
• work with (un)optimized sources 
• Pluggable resolution of resources 
• optimized, transpiled, gzipped, etc. 
• Insert versions in URLs for “cache busting” 
• Produce HTML5 AppCache manifests 
• Prepare links with CDN domain 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Enter 
Spring Framework 4.1 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Extending ResourceHttpRequestHandler 
• Two new auxiliary strategies forming two chains 
• ResourceResolver 
• ResourceTransformer 
• New component to determine “public” resource URLs 
• ResourceUrlProvider 
• internally delegates to resolver chain 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Built-in Resolvers 
• PathResourceResolver 
• simple path lookup under configured locations 
• VersionResourceResolver 
• resolution with version in URL path 
• GzipResourceResolver 
• lookup with.gz extension when “Accept-Encoding: gzip” 
• CachingResourceResolver 
• caching of resolved resource 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Built-in Transformers 
• CssLinkResourceTransformer 
• update links in CSS file (e.g. insert version) 
• AppCacheManifestTransformer 
• update links in HTML5 AppCache manifest 
• insert comment with content-based hash 
• CachingResourceTransformer 
• caching of transformed resource 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Resource URLs 
• No longer a simple location-relative paths 
• e.g. may need to insert version 
• ResourceResolver expected to 
• resolve resource 
• prepare “public” URL 
• ResourceUrlProvider 
• detects resource handler mappings on startup 
• returns “public” resource URL or null if not a resource URL 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How to render resource URLs in views? 
• ResourceUrlEncodingFilter 
• re-writes resource URLs 
• uses servlet response wrapper (overrides encodeUrl) 
• Works with JSP, FreeMarker, Velocity 
• and wherever response.encodeUrl is in use 
• Alternatively use ResourceUrlProvider directly 
• MVC Java config declares “mvcResourceUrlProvider” bean 
• also exposed as request attribute via interceptor 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How to render resource URLs in resources? 
• Resource can have embedded URLs 
• e.g. @import in CSS file 
• Use resource transformers to update URLs 
• CssLinkResourceTransformer 
• AppCacheManifestTransformer 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
VersionResourceResolver 
• Configured with one or more version strategies 
• mapped by pattern 
• ContentVersionStrategy 
• a.k.a “fingerprinting” URLs 
• FixedVersionStrategy 
• version from property file, current date, Github commit sha, etc. 
• inserted as prefix in the URL path 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Which VersionStrategy? 
• ContentVersionStrategy a good default choice 
• automated version 
• per-resource “cache busting” 
• FixedVersionStrategy still needed 
• with JavaScript module loaders 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Where we draw the line for the built-in support 
• Enable flexible resource resolution 
• Runtime transformation only where absolutely needed 
• e.g. update links inside CSS 
• Support URL versioning as first class feature 
• fingerprinting, fixed version, etc. 
• Work well with JavaScript build plugins 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Can Full “Asset Pipeline” Be Supported? 
• Yes, one example already exists 
• WUIC (http://wuic.github.io/) 
• The foundation is flexible for any approach 
• use any resolvers, transformers 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Demo 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Web configuration in dev 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Web configuration in production 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Handlebars Template and HTML output 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Groovy Template and HTML output 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Creating a Groovy Template Helper 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
HTML5 AppCache MANIFEST 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Questions? 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Learn More. Stay Connected 
Start your next app with 
Spring 4 and JDK8! 
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a 
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 
Check out Rossen’s 
“Spring 4 Web applications” 
@springcentral | spring.io/video

More Related Content

What's hot

Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
Srdjan Strbanovic
 
Mavenizing your Liferay project
Mavenizing your Liferay projectMavenizing your Liferay project
Mavenizing your Liferay project
mimacom
 
Simplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataSimplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring Data
VMware Tanzu
 
Running Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesRunning Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native Images
VMware Tanzu
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
Mika Koivisto
 
Expect the unexpected: Anticipate and prepare for failures in microservices b...
Expect the unexpected: Anticipate and prepare for failures in microservices b...Expect the unexpected: Anticipate and prepare for failures in microservices b...
Expect the unexpected: Anticipate and prepare for failures in microservices b...
Bhakti Mehta
 
JavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor App
Joe Kutner
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?
Edward Burns
 
What is maven
What is mavenWhat is maven
What is maven
sureshraj43
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
Edward Burns
 
Docker meetup-nyc-v1
Docker meetup-nyc-v1Docker meetup-nyc-v1
Docker meetup-nyc-v1
Srdjan Strbanovic
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
Pavel Bucek
 
Peering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for ObservabilityPeering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for Observability
VMware Tanzu
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
David Delabassee
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFX
Bruno Borges
 
5 best Java Frameworks
5 best Java Frameworks5 best Java Frameworks
5 best Java Frameworks
Aegis Softtech
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Werner Keil
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!
Reza Rahman
 

What's hot (20)

Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
Mavenizing your Liferay project
Mavenizing your Liferay projectMavenizing your Liferay project
Mavenizing your Liferay project
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
Simplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataSimplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring Data
 
Running Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesRunning Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native Images
 
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
JavaCro'15 - Managing Java at Scale Security and Compatibility Applications -...
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Expect the unexpected: Anticipate and prepare for failures in microservices b...
Expect the unexpected: Anticipate and prepare for failures in microservices b...Expect the unexpected: Anticipate and prepare for failures in microservices b...
Expect the unexpected: Anticipate and prepare for failures in microservices b...
 
JavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor App
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?
 
What is maven
What is mavenWhat is maven
What is maven
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
 
Docker meetup-nyc-v1
Docker meetup-nyc-v1Docker meetup-nyc-v1
Docker meetup-nyc-v1
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
 
Peering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for ObservabilityPeering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for Observability
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFX
 
5 best Java Frameworks
5 best Java Frameworks5 best Java Frameworks
5 best Java Frameworks
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!
 

Viewers also liked

Centralized Application Configuration with Spring and Apache Zookeeper
Centralized Application Configuration with Spring and Apache ZookeeperCentralized Application Configuration with Spring and Apache Zookeeper
Centralized Application Configuration with Spring and Apache Zookeeper
Ryan Gardner
 
DTI Sales Promotion Permit Application Process
DTI Sales Promotion Permit Application ProcessDTI Sales Promotion Permit Application Process
DTI Sales Promotion Permit Application Process
Janette Toral
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2
Rossen Stoyanchev
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
Dmytro Chyzhykov
 
Spring 4.x Web Application 살펴보기
Spring 4.x Web Application  살펴보기Spring 4.x Web Application  살펴보기
Spring 4.x Web Application 살펴보기
Ji Heon Kim
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Emprovise
 
Spring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trendsSpring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trends
Arawn Park
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Aaron Schram
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Abdelhakim Bachar
 
spring.io를 통해 배우는 spring 개발사례
spring.io를 통해 배우는 spring 개발사례spring.io를 통해 배우는 spring 개발사례
spring.io를 통해 배우는 spring 개발사례
Daehwan Lee
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Roman Pichlík
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring Framework
Edureka!
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
Mohit Gupta
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 update
Joshua Long
 
Spring MVC - The Basics
Spring MVC -  The BasicsSpring MVC -  The Basics
Spring MVC - The Basics
Ilio Catallo
 
Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVCGuy Nir
 

Viewers also liked (17)

Centralized Application Configuration with Spring and Apache Zookeeper
Centralized Application Configuration with Spring and Apache ZookeeperCentralized Application Configuration with Spring and Apache Zookeeper
Centralized Application Configuration with Spring and Apache Zookeeper
 
DTI Sales Promotion Permit Application Process
DTI Sales Promotion Permit Application ProcessDTI Sales Promotion Permit Application Process
DTI Sales Promotion Permit Application Process
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
 
Spring 4.x Web Application 살펴보기
Spring 4.x Web Application  살펴보기Spring 4.x Web Application  살펴보기
Spring 4.x Web Application 살펴보기
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trendsSpring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trends
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
spring.io를 통해 배우는 spring 개발사례
spring.io를 통해 배우는 spring 개발사례spring.io를 통해 배우는 spring 개발사례
spring.io를 통해 배우는 spring 개발사례
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring Framework
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 update
 
Spring MVC - The Basics
Spring MVC -  The BasicsSpring MVC -  The Basics
Spring MVC - The Basics
 
Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVC
 

Similar to Resource Handling in Spring MVC 4.1

Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
sdeeg
 
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
VMware Tanzu
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
cornelia davis
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET Microservices
VMware Tanzu
 
What's new in Spring Boot 2.0
What's new in Spring Boot 2.0What's new in Spring Boot 2.0
What's new in Spring Boot 2.0
VMware Tanzu
 
The Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudThe Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring Cloud
VMware Tanzu
 
Fast 5 Things You Can Do Now to Get Ready for the Cloud
Fast 5 Things You Can Do Now to Get Ready for the CloudFast 5 Things You Can Do Now to Get Ready for the Cloud
Fast 5 Things You Can Do Now to Get Ready for the Cloud
VMware Tanzu
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015
Daniel Woods
 
Deploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on KubernetesDeploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on Kubernetes
VMware Tanzu
 
Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs
VMware Tanzu
 
Experiences using grails in a Microservice Architecture SpringOne2gx 2014
Experiences using grails in a Microservice Architecture SpringOne2gx 2014Experiences using grails in a Microservice Architecture SpringOne2gx 2014
Experiences using grails in a Microservice Architecture SpringOne2gx 2014
Jeff Beck
 
Cloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at IntuitCloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at Intuit
VMware Tanzu
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
Marcin Grzejszczak
 
Cloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud ServicesCloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud Services
VMware Tanzu
 
S1P: Spring Cloud on PKS
S1P: Spring Cloud on PKSS1P: Spring Cloud on PKS
S1P: Spring Cloud on PKS
Mauricio (Salaboy) Salatino
 
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
confluent
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott Andrews
VMware Tanzu
 
Data Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring IntegrationData Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring Integration
Alvaro Videla
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud Foundry
VMware Tanzu
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
Stéphane Maldini
 

Similar to Resource Handling in Spring MVC 4.1 (20)

Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
 
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET Microservices
 
What's new in Spring Boot 2.0
What's new in Spring Boot 2.0What's new in Spring Boot 2.0
What's new in Spring Boot 2.0
 
The Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudThe Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring Cloud
 
Fast 5 Things You Can Do Now to Get Ready for the Cloud
Fast 5 Things You Can Do Now to Get Ready for the CloudFast 5 Things You Can Do Now to Get Ready for the Cloud
Fast 5 Things You Can Do Now to Get Ready for the Cloud
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015
 
Deploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on KubernetesDeploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on Kubernetes
 
Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs
 
Experiences using grails in a Microservice Architecture SpringOne2gx 2014
Experiences using grails in a Microservice Architecture SpringOne2gx 2014Experiences using grails in a Microservice Architecture SpringOne2gx 2014
Experiences using grails in a Microservice Architecture SpringOne2gx 2014
 
Cloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at IntuitCloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at Intuit
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Cloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud ServicesCloud Native Java with Spring Cloud Services
Cloud Native Java with Spring Cloud Services
 
S1P: Spring Cloud on PKS
S1P: Spring Cloud on PKSS1P: Spring Cloud on PKS
S1P: Spring Cloud on PKS
 
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott Andrews
 
Data Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring IntegrationData Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring Integration
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud Foundry
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
 

Recently uploaded

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 

Recently uploaded (20)

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 

Resource Handling in Spring MVC 4.1

  • 1. Resource Handling In Spring MVC 4.1 Brian Clozel, Rossen Stoyanchev Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 2. About the presenters • Brian Clozel • Spring framework committer • Sagan maintainer • Open source enthusiast • Rossen Stoyanchev • Spring framework committer • Consulting and training for Spring teams • Java and web development since 1998 Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 3. About the presentation • Web resource handling features in Spring Framework 4.1 • Provide context and guidance • Design choices, questions • Sample code Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 4. Resource Handling in Spring Framework Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 5. Resource Handling < 4.1 • Serve static resources from any Spring Resource location • classpath, file system, etc. • Basic cache header management • Expires, Cache-Control, Last-Modified • Easy to configure • MVC Java config and XML namespace • Or just map ResourceHttpRequestHandler Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 6. Remaining Questions • Optimize (minify, concatenate, etc.) • Transform (sass, less, gzip) • Use CDN • Effective HTTP caching (versioned URLs) • Develop, debug, and refresh (F5) with ease Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 7. Comprehensive strategy Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 8. Spring Framework 4.1 goal Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 9. Request for Fingerprinting URLs • http://jira.springsource.org/browse/SPR-10310 • Based on “asset pipeline” from Ruby on Rails • Adapt feature to Spring MVC • build on existing resource handling mechanism Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 10. URL “Fingerprinting” ?! • Technique for effective HTTP “cache busting” • Version URL with hash computed from file content • e.g. “/css/font-awesome.min-7fbe76cdac.css” • Add aggressive cache headers, e.g. +1 year • Resource is cached in browser (until content changes) Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 11. Full Spring MVC “Asset Pipeline” Proposal • Independently a proposal for complete “asset pipeline” • via @robertharrop (Spring Framework founder) • Initial investigation lead to major fork in the road • JavaScript build tasks offer attractive alternative • e.g. Grunt • huge ecosystem, many plugins of interest • works with any backend • Runtime vs build-time approach and trade-offs Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 12. Yet another development Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 13. Sagan: http://spring.io • Written with Spring • by Pivotal Labs (deep RoR knowledge) and Chris Beams • launched during SpringOne 2GX keynote • Aggressive deadline, some technical debt • pay-off due prior to open-sourcing • Improve client side • with help from @unscriptable and @briancavalier (cujo.js fame) Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 14. Client Source Code Layout • Modern client as 1st class citizen in a Java project • Server and client side are each entitled to: • dependency management • modularity • tests • build artifacts (e.g. minification, concatenation) • Use of src/main/webapp is just not adequate any more • Common but behind the times Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 15. Sagan Project Structure Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 16. The sagan-client module • Separate module • Lets you follow best practices • node.js / npm for node dependencies • bower: 3rd party dependency management (like Maven for Java) • curl, cram: module loading and concatenating • gulp: build tasks • Gradle integrated Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 17. Working with Sagan Client Sources • We’re no longer using src/main/webapp • How to keep the same smooth, just-hit-F5, dev experience? • Copying files at build time, not the way to go! Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 18. How Sagan Serves Static Resources? • Spring profiles (“dev”, “prod”, etc) • In dev mode serve directly from source location • i.e. • where saganPath is initialized from a property • In production from classpath (minified, concatenated) • JavaScript source maps for debugging in production Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 19. Managing front-end dependencies • WebJars: refers to “resources bundled in a jar” • Sagan • manage client dependencies with npm and bower • bundle a single JAR • Spring Boot serves from classpath:/static • www.webjars.org • front-end dependencies as jars from Maven central • plus bundle client application sources (“src/main/webapp”) Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 20. Sagan Summary • Production Spring application • Open source github.com/spring-io/sagan • Separate talk about Sagan: “Inside spring.io a production Spring reference application” Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 21. Sample Application github.com/SpringOne2GX-2014/spring-resource-handling Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 22. Demo Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 23. Demo Summary • Bower downloads dependencies • e.g. curl 0.8.10, jquery 2.0.3, bootstrap 3.1.1, less 1.7.3 • Gulp.js plugins • cram, uglify, minify-css, bower-src, pngcrush, etc. • Optimize .js, .css, images under src/ + copy to dist/ • including bower-managed sources • Gradle-driven • bundle dist under classpath:/static Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 24. JavaScript Build Tasks (Gulp, Grunt) • Tremendous choice • Rich ecosystem, continues to evolve • Sagan switched from Grunt to Gulp in its relatively short life • Best way to remain aligned with client trends • Works well with any server (Java, Ruby, etc) and client (JS, Dart, ES6, TypeScript) Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 25. How can Spring MVC help? • Make it easy to switch between environments • work with (un)optimized sources • Pluggable resolution of resources • optimized, transpiled, gzipped, etc. • Insert versions in URLs for “cache busting” • Produce HTML5 AppCache manifests • Prepare links with CDN domain Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 26. Enter Spring Framework 4.1 Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 27. Extending ResourceHttpRequestHandler • Two new auxiliary strategies forming two chains • ResourceResolver • ResourceTransformer • New component to determine “public” resource URLs • ResourceUrlProvider • internally delegates to resolver chain Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 28. Built-in Resolvers • PathResourceResolver • simple path lookup under configured locations • VersionResourceResolver • resolution with version in URL path • GzipResourceResolver • lookup with.gz extension when “Accept-Encoding: gzip” • CachingResourceResolver • caching of resolved resource Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 29. Built-in Transformers • CssLinkResourceTransformer • update links in CSS file (e.g. insert version) • AppCacheManifestTransformer • update links in HTML5 AppCache manifest • insert comment with content-based hash • CachingResourceTransformer • caching of transformed resource Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 30. Resource URLs • No longer a simple location-relative paths • e.g. may need to insert version • ResourceResolver expected to • resolve resource • prepare “public” URL • ResourceUrlProvider • detects resource handler mappings on startup • returns “public” resource URL or null if not a resource URL Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 31. How to render resource URLs in views? • ResourceUrlEncodingFilter • re-writes resource URLs • uses servlet response wrapper (overrides encodeUrl) • Works with JSP, FreeMarker, Velocity • and wherever response.encodeUrl is in use • Alternatively use ResourceUrlProvider directly • MVC Java config declares “mvcResourceUrlProvider” bean • also exposed as request attribute via interceptor Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 32. How to render resource URLs in resources? • Resource can have embedded URLs • e.g. @import in CSS file • Use resource transformers to update URLs • CssLinkResourceTransformer • AppCacheManifestTransformer Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 33. VersionResourceResolver • Configured with one or more version strategies • mapped by pattern • ContentVersionStrategy • a.k.a “fingerprinting” URLs • FixedVersionStrategy • version from property file, current date, Github commit sha, etc. • inserted as prefix in the URL path Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 34. Which VersionStrategy? • ContentVersionStrategy a good default choice • automated version • per-resource “cache busting” • FixedVersionStrategy still needed • with JavaScript module loaders Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 35. Where we draw the line for the built-in support • Enable flexible resource resolution • Runtime transformation only where absolutely needed • e.g. update links inside CSS • Support URL versioning as first class feature • fingerprinting, fixed version, etc. • Work well with JavaScript build plugins Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 36. Can Full “Asset Pipeline” Be Supported? • Yes, one example already exists • WUIC (http://wuic.github.io/) • The foundation is flexible for any approach • use any resolvers, transformers Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 37. Demo Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 38. Web configuration in dev Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 39. Web configuration in production Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 40. Handlebars Template and HTML output Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 41. Groovy Template and HTML output Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 42. Creating a Groovy Template Helper Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 43. HTML5 AppCache MANIFEST Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 44. Questions? Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
  • 45. Learn More. Stay Connected Start your next app with Spring 4 and JDK8! Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Check out Rossen’s “Spring 4 Web applications” @springcentral | spring.io/video