tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: ServletContextListener - how to detect http path of web application?
Date Wed, 21 Dec 2005 11:22:37 GMT
There is no way to detect the contextPath on servletInit. It can only be done 
after the first request. (Using HttpServletRequest.getContextPath())


-Tim

Iain.Shepherd@barclayscapital.com wrote:
> Hi,
> 
> Apols for a newbie question, I didn't have much luck with the archives
> or in Google.
> 
> In my ServletContextListener.contextInitialized method, I need to detect
> the public http path of my web app.
> i.e. http://servername/approot/
> 
> How can I do this?
> event.getServletContext().getResource("/") gives me "jndi:/localhost/",
> not very helpful.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message