HttpServletRequest.getContextPath() returns the context path name.

jon wingfield wrote:
> you could extract it from servletContext.getRealPath("/");
> 
> -----Original Message-----
> From: shanmugampl [mailto:[EMAIL PROTECTED]]
> Sent: 04 October 2002 12:51
> To: [EMAIL PROTECTED]
> Subject: Getting the name of the context
> 
> 
>   Hi,
> 
> I have a requirement where i need to know the name of the context i am 
> in.Say i have a servlet class present in my <Tomcat_Home>/webapp/myapp/. 
> Now i want to get the name of the application(in this case 'myapp') from 
> my servlet. Is there a way of doing it. One of the way i found was 
> specifying a name for the <display-name> attribute present in the 
> web.xml. This name can be retrieved from the ServletContext. The problem 
> here is two contexts can have the same display name which is not desired.
> 
> Thanks
> Shanmugam.PL
> 
>  


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to