You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Henri Dupre <he...@gmail.com> on 2005/07/14 00:14:46 UTC

3 -> 4 porting issues

I'm currently porting our upcoming website to tapestry 4.
How can I access the servlet object? I need to query one of the init
parameters (where I store the version)

Also in the engine object, I was loading an xml file into the global
context in the setupforrequest method, but it seems to have gone now.
Where should I do it now?
 
Thanks,

Henri.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: 3 -> 4 porting issues

Posted by "Scott F. Walter" <sc...@scottwalter.com>.
Henri Dupre wrote:

>I'm currently porting our upcoming website to tapestry 4.
>How can I access the servlet object? I need to query one of the init
>parameters (where I store the version)
>
>Also in the engine object, I was loading an xml file into the global
>context in the setupforrequest method, but it seems to have gone now.
>Where should I do it now?
> 
>Thanks,
>
>Henri.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>  
>
I don't see a way to access the servlet object directory, but if you 
inject service:tapestry.globals.ApplicationGlobals into your page, you 
can then call getWebContext() that has access to the servlet's init 
parms.  Here's an example

    @InjectObject("service:tapestry.globals.ApplicationGlobals")
    public abstract ApplicationGlobals getApplicationGlobals();

then you could:

getApplicationGlobals().getWebContext().getInitParameterValue("some key");

Of couse you don't have to use annotations, you could use <inject> 
inside your specification file.

scott.

-- 

Scott F. Walter 	Scott F. Walter
Principal Consultant
Vivare, Inc.

E: scott.walter@vivare.com
E: scott@scottwalter.com
Visit scottwalter.com <http://scottwalter.com> --Point.  Click.  Explore!




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org