Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MessageResource vs init-parm

 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I need to store the path to a file and retrieve it in a Struts Action class.
I assume I cant use a messageresource, but I can retrieve it from a servlet
with <context><param-name>...</context> and getServletContext.
getInitParmameter(""). But cant see what different method to use to do it in an Action class. What is the correct approach and syntax? Thank you.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
simple external properties file (resource bundle), the simple and classic way of getting a fixed environment value. this makes it independent of struts thus you can access it from anywhere in your app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic