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 Can I use web.xml in struts app for storing some param values? 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 "Can I use web.xml in struts app for storing some param values?" Watch "Can I use web.xml in struts app for storing some param values?" New topic
Author

Can I use web.xml in struts app for storing some param values?

Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
Hi,
I am using Struts for My web Development. Now can I use my Web.xml file for storing value of some application specific parameters(Like image upload directory path, etc). If yes, how to do that? Should I use <init-param>?
& also Later how can I refer values of these parameters into my application files?
Please help me.
Thank you.
Pras


********Deserve Before You Desire********
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest using servlet context parameters. You define them like this:


and retreive them in your action class like this:



Merrill
Consultant, Sima Solutions
 
wood burning stoves
 
subject: Can I use web.xml in struts app for storing some param values?
 
Similar Threads
Map with duplicate keys
passing intialisation values to an application
getting initialisation parameters in JSP
How do I detect the server info?
Difference between application and message-resources