Configuring static resources for use within the application in JBoss AS 7
In previous versions of JBoss, you could link an external directory into the classpath and load static resources like images/CSS/JS into the application using the WEB-INF/context.xml <Context allowLinking="true" cookies="true" crossContext="true" override="true"> <Resources allowLinking="true" homeDir="/mydomain/staticfiles" /> </Context> In Weblogic servers, there is the virtual-directory-mapping to achieve this. In Jboss 7 this no longer works, and you need to bundle the static files within the EAR or War. Note: If you need to serve these over the browser like a public web server as static files then you need a servlet method like this http://balusc.blogspot.com/2007/04/imageservlet.html But if you want to load a static property file or other content into your webapp, the solution provided by Jboss is what this post is about. You can define a “module” within JBOSS_HOME and store the files...