• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Is it possible to access WAR properties file in JSTL?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah I missed that at first glance that you were not using setBundle. With the old way you could have done this:



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic