File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve context parameter?

 
Taka Chan
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Struts and Tomcat 5 and I have setup a parameter in web.xml as context parameter. I will like to know, is there any way I can retrieve value of this parameter from a class that is not inheriting HttpSerlvet ?

As I am a newbie and just know that I can retrieve this from the context of the web application. I would like to write a DAO class that does not inherite any class to retrieve the context paramter. Any suggestion?

Thank you in advance.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your DAO probably shouldn't know anything about the code between it and the user.

I say it's a better idea to design the methods of the DAO so they accept that context value as a parameter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic