[jboss-user] [Javassist user questions] - Re: how to load external property file in JBOSS

informsantosh do-not-reply at jboss.com
Wed Nov 15 16:11:23 EST 2006


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}
    


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986308#3986308

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986308



More information about the jboss-user mailing list