request.getContextPath() works in both servlets and JSP's (as JSP's are 
servlets).  I don't suggest ever hardcoding anything to use specific 
container's (including tomcat's) API's.  Keep to the spec.

Hope this helps,
David

--

chiuming wrote:

> hi,
> any way I can get a servlet context ( web application
> )'s name with in a servlet?  on Servlet API 2.2 (not
> Servlet 2.3)
> 
> -OR- there is no way to do that?
> 
> P.S. I am using tomcat... may I access internal tomcat
> object to achieve that?
> 
> thanks
> 
> __________________________________________________
> Do You Yahoo!?
> Listen to your Yahoo! Mail messages from any phone.
> http://phone.yahoo.com

 >

Reply via email to