Search code examples
jbossseamweb.xml

How to load config.properties file in a Seam Application using web.xml context-param


I have a seam web application in which I have to include a security module for integrated authentication. I can see that the module isn't based on seam application because it uses a spring-like notation. As the module works defining a listener and a properties file in the web.xml I think it should also work in my app.

Problems are: I don't have access to the module's sourcecode. And it fails to load the config.properties file.

The module hopes to load the file through the following configuration. So I place the config.properties at the same path directory as the web.xml.

web.xml:

<context-param>
    <param-name>securityLocation</param-name>
    <param-value>config.properties</param-value>
</context-param>

I can only assume that at some point some method like getResourceAsStream can't find the file.

I'm using SEAM 2.2.2 and jboss 5 EAP, I wonder when/how the jboss container solve this context-param at web.xml and where it assumes the file may be.

Sorry for the poor english.


Solution

  • Move the config.properties file into WEB-INF/classes.

    It will not be accessible from the class loader if it's just in WEB-INF.