Announcement Announcement Module
Collapse
No announcement yet.
Reading values stored in properties file from JSP Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading values stored in properties file from JSP

    Is there a standard Spring webmvc mechanism to read from a properties file in JSP pages? I'm happy to do this in a controller and pass the values as part of the model. But then I have to deal with the following:
    • performance
    • cache properties
    • poll file for changes (this isn't so important for me)
    Basically I have properties files for various environments my app runs in (dev, production, sandbox, etc). Wondering if there's a standard Spring way to deal with this.

  • #2
    Check out this appendix in Spring documentation for the spring.tld tag library. There's a message tag for retrieving values from properties files. It's used for internationalization, but you could use it for what you're after too.

    Comment


    • #3
      Originally posted by pgrimard View Post
      There's a message tag for retrieving values from properties files. It's used for internationalization, but you could use it for what you're after too.
      Interesting, we do use <fmt:message> extensively from the JSTL for internationalization. Never thought about using it for environment properties as well... Seems like it should work, but I'd prefer to have a specific properties file or location for environment settings. We dynamically generate our i18n properties files..

      Comment

      Working...
      X