That's interesting :) 

Another aspect to consider is the fact that a virtual host can
correspond/accept multiple domain names, multiple ports, etc. In addition
the sample application instance could perfectly well be attached to several
virtual hosts at the same time. 

For those reasons, I don't want to change the API. The best in your case is
to manually pass this info to your application. You can also rely on
application's context parameters to pass the host info as this will be more
portable when support WAR-style packaging in 1.1.

Best regards,
Jerome  

> -----Message d'origine-----
> De : Chuck Hinson [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi 20 février 2007 19:01
> À : [email protected]
> Objet : RE: RE: RE: Find host info from Application
> 
> Except that when I need the host info, I don't have a Request 
> object handy.  In fact, when I need the host info, my 
> application may not have even received any requests yet.
>  
> The application needs to know host info for application 
> initialization.  There are data structures that need to be 
> set up before any requests are ever handled.
> 
> --Chuck 
> 
> -----Original Message-----
> From: Jerome Louvel [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 20, 2007 12:43 PM
> To: [email protected]
> Subject: RE: RE: Find host info from Application
> 
> 
> Ok I see. For this you can use the Request.getRootRef() 
> method that was recently added.
> 
> Best regards,
> Jerome  
> 
> > -----Message d'origine-----
> > De : Chuck Hinson [mailto:[EMAIL PROTECTED] Envoyé : 
> mardi 20 
> > février 2007 18:29 À : [email protected] Objet : 
> RE: RE: Find 
> > host info from Application
> > 
> > I need, for example, to find out what the canonical 
> hostname/base url 
> > of my deployment environment is.
> > 
> > For example, when creating atom:source elements, I have to 
> be able to 
> > construct a URL for a feed (that's part of my application), and I 
> > can't do that if I don't know what my hostname and port number are.
> > 
> > --Chuck
> > 
> > -----Original Message-----
> > From: Jerome Louvel [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 20, 2007 12:12 PM
> > To: [email protected]
> > Subject: RE: Find host info from Application
> > 
> > 
> > Hi Chuck,
> > 
> > As an Application is expected to be portable from one deployment 
> > environment to another, we intentionally don't have a 
> reference to the 
> > parent VirtualHost.
> > 
> > I would be interested to know what is the requirement 
> leading you in 
> > the path. For now, if you really need this reference, you should 
> > manually pass it to the constructor of your application.
> > 
> > Best regards,
> > Jerome
> > 
> > > -----Message d'origine-----
> > > De : Chuck Hinson [mailto:[EMAIL PROTECTED] Envoyé : 
> > mardi 20
> > > février 2007 18:06 À : [email protected] Objet : 
> Find host 
> > > info from Application
> > > 
> > > 
> > > From within an Application, how does one get hold of the
> > VirtualHost
> > > to which the application is attached?
> > > 
> > > --Chuck
> > > 
> > > 
> > > ------------------------------------
> > > Chuck Hinson
> > > Gestalt LLC
> > > phone: 610.994.2833
> > > IM: chucking24 (Yahoo)
> > >  

Reply via email to