This application demonstrates new resource handling features in Spring Framework 4.1. It was originally developed for the talk Resource Handling in Spring MVC 4.1 talk at SpringOne2GX 2014.
This projects requires a local install of node+npm (see nvm).
The easiest way to get started - from the project root - development version:
SPRING_PROFILES_ACTIVE=development ./gradlew :server:bootRun
Or the production version (more optimizations):
SPRING_PROFILES_ACTIVE=production ./gradlew :server:bootRun
Then go to:
- http://localhost:8080/ for an example with JMustache templating
- http://localhost:8080/groovy for an example with Groovy Template Engine
- http://localhost:8080/app for an example with an HTML5 AppCache Manifest (you can check this in Chrome with chrome://appcache-internals/ )
- http://localhost:8080/less for an example with a LESS stylesheet; this page uses less files and the LESS JS transpiler in development mode, and a transpiled version in production
- http://localhost:8080/jsp for a JSP example
- http://localhost:8080/velocity for a Velocity example
Interesting parts of the application:
- configuring resource handlers with resource resolvers and resource transformers
- a sample template file using JMustache and a custom Mustache lambdas to resolve URLs to static resources