RE: ServletContextListener - how to detect http path of web application?

2005-12-22 Thread Iain.Shepherd
Frank, > > Martin, I can't get a HttpServletRequest from Filter.init. > > I can get a ServletContext... but I can also get that from a > > ServletContextListener. So I can throw away this silly Filter now. > > One reason a filter would be better is you can fully > construct the URL dynamically,

RE: ServletContextListener - how to detect http path of web application?

2005-12-21 Thread Iain.Shepherd
Frank, your solution (using the ServletContext) does work. Thanks. Martin, I can't get a HttpServletRequest from Filter.init. I can get a ServletContext... but I can also get that from a ServletContextListener. So I can throw away this silly Filter now. Cheers everyone. -Original Message---

RE: ServletContextListener - how to detect http path of web application?

2005-12-21 Thread Iain.Shepherd
Thanks, I might try that. I already made a javax.servlet.Filter, that catches the first request to the server, calls HttpServletRequest.getContextPath(), and stores the result. Of course the Filter actually gets hit on *every single request* to the server. You might call it a brute force solution

RE: ServletContextListener - how to detect http path of web application?

2005-12-21 Thread Iain.Shepherd
Thanks Tim. -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 21 December 2005 11:23 To: Tomcat Users List Subject: Re: ServletContextListener - how to detect http path of web application? There is no way to detect the contextPath on servletInit. It can only be done af

ServletContextListener - how to detect http path of web application?

2005-12-21 Thread Iain.Shepherd
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("/") give