-
1. Re: how to load external property file in JBOSS
informsantosh Nov 15, 2006 4:11 PM (in response to sandipvdhande)Hi
To access the propery file change the ant script to include that file in WEB-INF/ folder and add in the war.
If you are using some frameworks like struts or spring its pretty easy to load property files. For struts you can refer to the example like how they load application message properties. For Spring i am giving you sample code below
if property file is like
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost/test
jdbc.user=postgres
jdbc.password=
And your bean configuration will look like this:
/WEB-INF/jdbc.properties
${jdbc.driver}
${jdbc.url}
${jdbc.user}
${jdbc.password} -
2. Re: how to load external property file in JBOSS
informsantosh Dec 29, 2006 5:42 PM (in response to sandipvdhande)Hi ,
I have used another way I have added system/application properties to properties-service.xml, This file can be found at server/default/deploy.
To acess the variables declared in properties-service.xml , we will be able to access these varibles ${test.name}, This variable can be acceed from any config file like spring app-context.xml / web.xml . These properties can loaded prior to loading EJB/ any jar -
3. Re: how to load external property file in JBOSS
jefo Feb 22, 2008 2:39 PM (in response to sandipvdhande)Hi guys,
I have followed some tips in other posts but I cannot make this works.
My properties-service.xml<attribute name="Properties"> myProperty=myPropertyValue </attribute>
my app-servlet.xml<bean id="MyService" class="acme.MyServiceImp"> <property name="myProperty" value="${myProperty}"/> </bean>
The issue is that the ${myProperty} value in my app-servlet.xml are not bind to the correct value that I spect for, myPropertyValue.
Is there some additional spring conf that I forgot?!?
Any help will be apreciate, tks. -
4. Re: how to load external property file in JBOSS
eabrand Dec 19, 2011 11:48 AM (in response to jefo)Did this ever get resolved?