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 Web Services and the fly likes trivial question 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 » Java » Web Services
Bookmark "trivial question" Watch "trivial question" New topic
Author

trivial question

Vicky Pandya
Ranch Hand

Joined: Dec 16, 2004
Posts: 148
I have a context-param in web.xml. I need to access value of this variable from ServletContext into a POJO (no passing HttpServletRequest or anything). Basically this POJO is not aware of any servletcontext or container. How do I get value of this context variable into POJO.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Passing it to your POJO in an Action via a setter method would be one way to accomplish this.
Vicky Pandya
Ranch Hand

Joined: Dec 16, 2004
Posts: 148
I don't have action here. This POJO is being called from a webservice class, which doesn't extend servlet or any of its classes. Any other way?
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Then it seems this question doesn't really have anything to do with Struts. Since you say it has something to do with web services, I'm going to move this to the web services forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trivial question
 
Similar Threads
Plain Java Class needs access to ServletContext
web app env-entry in web.xml
accessing object from servlet to pojo class
ServletContext outside the Servlet Container
How to acess servlet context variables from java class