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

2005-12-22 Thread Frank W. Zammetti
[EMAIL PROTECTED] wrote: One reason a filter would be better is you can fully construct the URL dynamically, including the method and all that. Could you possibly map it to just the initial entry point of your app so that it doesn't fire with each request? Yeah I thought about that... unfor

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 James McGill
> Subject: Re: ServletContextListener - how to detect http path of web > application? We have a similar sounding problem. We want a ContextListener to be able to determine the http path and the port, in order to advertise webapps via ZeroConf MDNS (Rendezvous, Bonjour, whatever th

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

2005-12-21 Thread Frank W. Zammetti
On Wed, December 21, 2005 1:10 pm, [EMAIL PROTECTED] said: > Frank, your solution (using the ServletContext) does work. Thanks. Good news (sigh of relief!) > Martin, I can't get a HttpServletRequest from Filter.init. > I can get a ServletContext... but I can also get that from a > ServletContextL

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

2005-12-21 Thread Iain.Shepherd
ssage- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: 21 December 2005 17:28 To: Shepherd, Iain: IT (LDN) Cc: Tomcat Users List Subject: Re: ServletContextListener - how to detect http path of web application? Iain- Unless of course you only make this assignment in the init method T

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

2005-12-21 Thread Martin Gainty
Iain- Unless of course you only make this assignment in the init method Thanks, Martin- - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, December 21, 2005 12:17 PM Subject: RE: ServletContextListener - how to detect http path of web application? Thanks, I mig

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

2005-12-21 Thread Iain.Shepherd
solution :-) Iain -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: 21 December 2005 17:00 To: Tomcat Users List Cc: Tomcat Users List Subject: Re: ServletContextListener - how to detect http path of web application? Tim is right, you can't do it directly. You *

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

2005-12-21 Thread Frank W. Zammetti
Tim is right, you can't do it directly. You *might* be able to construct it in a roundabout way though... Let's assumg you know the method, http vs. https, and its always one or the other. Let's also assume that the element in web.xml names the application context (i.e., if the URL is http://my

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

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

2005-12-21 Thread Tim Funk
There is no way to detect the contextPath on servletInit. It can only be done after the first request. (Using HttpServletRequest.getContextPath()) -Tim [EMAIL PROTECTED] wrote: Hi, Apols for a newbie question, I didn't have much luck with the archives or in Google. In my ServletContextListe

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