Exposing resources from jar files in web applications (Tomcat7)

There is a feature in servlet 3.0 that allows you to package resources (images, jsp, etc.) in a JAR file. What you do is in your jar file, you create META-INF/resources and dump anything you want in there including directories for structuring your resources. What happens is that META-INF/resources will be mapped to the docroot of your web application.

When there is a clash of resource between your app and the JAR file, your apps resource will be returned. See this

Tomcat 7 supports Servlet 3 so it should support this feature

Leave a Comment