You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Vennervald Madsen <jv...@gopinocchio.com> on 2002/06/27 14:19:05 UTC

Getting the map of the webapp

Hi List

Is there any way I can get the path to the current webapp?

Example:
My webapp is called test.
This means that when I want to use that webapp the url should look
something like this 
http://<the_hostname_of_the_machine>/test/index.html
Is there any way can get the name test in my servlet so I want have to
hardcode it?

I know how to get the real filesystem path but not the URL path.

Jacob

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Getting the map of the webapp

Posted by Milt Epstein <me...@uiuc.edu>.
On Thu, 27 Jun 2002, Jacob Vennervald Madsen wrote:

> Hi List
>
> Is there any way I can get the path to the current webapp?
>
> Example:
> My webapp is called test.
> This means that when I want to use that webapp the url should look
> something like this
> http://<the_hostname_of_the_machine>/test/index.html
> Is there any way can get the name test in my servlet so I want have to
> hardcode it?
>
> I know how to get the real filesystem path but not the URL path.

How about getContextPath() (it's in the request)?

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>