Hi,
>The code in 'MyContext' is a library of code that I am hoping to be
able
>to reuse in serval sites on the same server. The thing is it needs a
>config file and I would like the config file to always be in the root
>of the site. The thing is if I do a get getRealPath("/") from the code
>in MyContext it will always return SomePath3. How do I get the docbase
>of the "" context, (SomePath2)? or even of the virtual host,
>(SomePath1), from with in MyContext.
>
>I guess I am asking if it is possible to getRealPath cross context?
Yes, it's possible: add crossContext="true" to your context definitions,
and use ServletContext#getContext to get the other context, then call
getRealPath on the other context.
That said, your approach is bad because webapps are supposed to be
independent and self-contained.
Yoav Shapira
This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged. This
e-mail is intended only for the individual(s) to whom it is addressed, and may not be
saved, copied, printed, disclosed or used by anyone else. If you are not the(an)
intended recipient, please immediately delete this e-mail from your computer system
and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]