This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: MessageResource vs init-parm
Similar Threads
read properties in my java application defined in spring bean "PropertyPlaceholderConfigurer"
html:link is not working
message resource help!!
Passing paramter from jsp to action class
struts - internationalization in Action class