File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Context, Path Question" Watch "Context, Path Question" New topic

Context, Path Question

John Groller

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.
I agree. Here's the link:
subject: Context, Path Question
It's not a secret anymore!