-
1. Re: How to use Jboss 6 to serve static content
wdfink Apr 27, 2015 5:39 AM (in response to zhujiabo1987)You might pack the property into a jar and add it to the classpath, this can be done as a library to be available for all applicaitons.
You can use the Classloader to find that property file then.
Other option is to create an MBean to access the file and provide the configuration, this is a server specific approach and you need to do a bit work.
If you use a database for this it might be a single point of configuration if you use a cluster. To read the configuration you might use a @Singleton bean
An approach which is also used, but not spec compliant is to add a java property to the jboss start where the property file is located and read it directly. This is not conform to the EJB spec as you should not use IO in your application. Also this might have issues in a cluster as each node need the same configuration.
-
2. Re: How to use Jboss 6 to serve static content
zhujiabo1987 Apr 27, 2015 8:41 PM (in response to wdfink)Thank you very much for your answer. I create a ROOT.war file and deploy it on Jboss server.I use this folder as container to hold my properties files. Now I face another challenge. Our application is using spring framework. and it use <context: property-placeholder location="path/app.properties"/> to load the properties file. Now since the app.properties file is stored on jboss server, what is the strategy to get this file mapped to our local application. Or if our application is deployed on the server, it can automatically get reference of this app.properties file.
-
3. Re: How to use Jboss 6 to serve static content
wdfink Apr 28, 2015 5:00 AM (in response to zhujiabo1987)Sorry, did not have Spring knowledge