Sheila's Blog

Software Development

Sheila's Blog header image 2

Serving static external content in JBoss

March 10th, 2009 by Sheila

To serve external static content in JBoss you need to add a Context element mapping the url eg. /application/test_data to the external folder as follows:

Edit /server/default/deploy/jbossweb-tomcat50.sar/server.xml and add a Context element just under the host tag. <host name="localhost" autoDeploy="false" deployOnStartup="false" deployXML="false" configClass="org.jboss.web.tomcat.security.config.JBossContextConfig"> <Context path="/app/test_data" appBase="" docBase="C:/test_data" debug="99" reloadable="true"> </Context>

Replace C:/test_data with the path to the folder on the server.

Redeploy the application to make sure that the config change has been picked up and then test that the files can be accessed.

Note: this content will be accessible without logging into the application if the url is known.

Tags:   No Comments

Leave a Comment

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.