I believe the original reason for this is the same as not being able t=
o get the server port -- the designers of the Servlet Specification wa=
nt web applications to be as portable and self-contained as possible. =
The app should function the same no matter what the server name, HTTP=
port, or context path is. That's their idea anyways (which I like), =
but it's not always explained well in the spec.
>From: jetty-discuss-admin@... [mailto:jetty-discuss=
>admin@...] On Behalf Of Greg Wilkins
>Sent: Wednesday, December 10, 2003 5:37 PM
>Subject: Re: [jetty-discuss] Gettting the context path of a webapp du=
>servlet initializati on
>Sheridan, Ga=EBtan wrote:
>> I am looking for a way to get the context path of a webapp while
>> initializing a servlet that is part of the webapp. Does anyone know=
>Strangely enough - that is just not supported by the servlet specific=
>I'm not really sure why. Originally it may have been because a webap=
>have been deployed at multiple context paths, so you would have to as=
>request which it was using. But the spec no longer supports a webapp=
>deployed at multiple contextpaths (well not the same instance anyway)=
>So the spec could provide this method, but it does not.
>Your only standard solution is to pass in the context path with an
>This SF.net email is sponsored by: IBM Linux Tutorials.
>Become an expert in LINUX or just sharpen your skills. Sign up for I=
>Free Linux Tutorials. Learn everything from the bash shell to sys ad=
>Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dcli=
>jetty-discuss mailing list
This e-mail, including any attachments, is a confidential business com=
munication, and may contain information that is confidential, propriet=
ary and/or privileged. This e-mail is intended only for the individua=
l(s) to whom it is addressed, and may not be saved, copied, printed, d=
isclosed or used by anyone else. If you are not the(an) intended reci=
pient, please immediately delete this e-mail from your computer system=
and notify the sender. Thank you.