jQuery in Action, 3rd edition
The moose likes Struts and the fly likes MessageResource vs init-parm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "MessageResource vs init-parm" Watch "MessageResource vs init-parm" New topic

MessageResource vs init-parm

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
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

Joined: Apr 14, 2005
Posts: 354
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.

-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: MessageResource vs init-parm
It's not a secret anymore!