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 Beginning Java and the fly likes Context, Path 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 » Beginning Java
Bookmark "Context, Path Question" Watch "Context, Path Question" New topic
Author

Context, Path Question

John Groller
Greenhorn

Joined: May 08, 2008
Posts: 5
Hello JavaRanch!

I've got a class in a WAR. It's not a servlet, it's just a straight up class. However, it will be invoked when a SOAP call comes in from our vendor.

To load a Bean that I need, I'm doing this...



My problem is that no relative path that I use works. Physical paths do work, but since I'm developing on a Windows box and will be deploying to AIX boxes, physical paths won't match up.

Is there a way for me to determine the context root of the WAR in a class that's not a Servlet (and therefore does not have an HttpServletRequest object)? I read somewhere that I could grab the SOAPContext and use that, but that just seemed like a lot of work to do something simple.

Thanks in advance for any help.
John
 
jQuery in Action, 2nd edition
 
subject: Context, Path Question
 
Similar Threads
deploy application in server
filter for j_security_check
How to make utility JAR's in EAR's available to WAR's....
Tomcat: How can change root context and extracted files?
compiling servlets under Tomcat 4.0