Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Can I use web.xml in struts app for storing some param values?
 
It's not a secret anymore!