First, some quick background: fiftyfive-wicket is our open source project where we maintain useful tools and suggest practical design patterns for the popular Apache Wicket Java web framework. We also bundle these tools and patterns as a nice Maven archetype that can be used to kickstart new projects. We released version 3.2 on Wednesday, January 25, 2012. Quick start instructions and Maven dependency syntax can be found in the fiftyfive-wicket README.
SimpleCDN uses Wicket 1.5’s request mapping system
The new SimpleCDN class in fiftyfive-wicket 3.2 is built on top of Wicket 1.5’s request mapper system, which (to oversimplify a bit) is how Wicket generates URIs and routes browser requests. In 1.5, an application or library developer can easily plug into this system to build enhancements that would have been prohibitively difficult in previous Wicket versions. If you aren’t familar with 1.5 request mapping, I suggest you take a look at the SimpleCDN source code to see exactly how this style of plugin is accomplished.
In a nutshell, SimpleCDN rewrites URIs that point to sytlesheets, scripts, and other static files that are normally served by Wicket. If you are familiar with Rails, it is very similar to the Rails
action_controller.asset_host feature. Combine this with a reverse proxy cache like Amazon Cloudfront, and you’ll be up and running very quickly.
Normally a CSS resource reference is rendered by Wicket like this:
With SimpleCDN installed, that resource reference URL is transformed into something like this:
Installation is just a matter of adding a few lines to your Application#init.
For more details, refer to the SimpleCDN Javadoc.
Other fiftyfive-wicket 3.2 changes
Along with SimpleCDN, fiftyfive-wicket 3.2 has been updated with Wicket 1.5.4, Spring 3.1.0, and Apache Shiro 1.2.0. You can refer to the full release notes. Visit our GitHub project to fork, report issues, or browse the source. You can also get in touch with us at email@example.com if you have questions.
- Apache Wicket
- fiftyfive-wicket v3.2 tag on GitHub
- README.md (a detailed description of the project, plus a simple tutorial)
- Javadoc API documentation
- 55 Minutes open source Maven repository