wood burning stoves 2.0*
The moose likes Spring and the fly likes Is it possible to access WAR properties file in JSTL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Is it possible to access WAR properties file in JSTL?" Watch "Is it possible to access WAR properties file in JSTL?" New topic
Author

Is it possible to access WAR properties file in JSTL?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using Spring 3.1.1.RELEASE on JBoss 7. I have a WAR file with a properties file, "application.properties" located in the WEB-INF/classes directory. Is it possible to access properties from this file through JSTL? I have tried



but calling



outputs "???default.country.selected???". Thanks for any guidance, - Dave
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Are you sure application.properties is in the root of the classpath? Have you cracked open the war and verified? Also verify it is spelled correctly.


[How To Ask Questions][Read before you PM me]
Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
When you say "root of your classpath", do you mean at the root of my WEB-INF/classes directory? If so, yes, I've verified that the file is appearing there and the property I mentioned exists. Am I to assume from your questions that everything is set up correctly?
Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Ah, I discovered I didn't have things setup properly. Changing



to



fixed my problem (I'm able to access properties now). -
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Yeah I missed that at first glance that you were not using setBundle. With the old way you could have done this:



 
 
subject: Is it possible to access WAR properties file in JSTL?
 
Similar Threads
Conversion to JSTL - Help
having trouble converting values on my jsp
Taglibs not found problem
Expressions problem
OC4J 10.1.3