That won't work in a context listener. Servlet Spec 2.5 includes a
servletContext.getContextPath(), but Tomcat only implements 2.4 (not
sure when the new Tomcat is slated for release).

I struggled with the same thing a few days ago, trying to have log4j
stream to a file named for the context when configured
semi-programmatically. I gave up in the end.

David Delbecq wrote:

> asaf.lahav wrote:
>
>>  
>>
>> How can I obtain the name of the web application name my listener
>> servlet is
>> running under in Java?
>>
>>
>>   
>
> request.getContextPath();
>
> Greetings.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-- 
______________________________
Avi Deitcher
[EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to