You might like to try the suggestion on the following page.

http://lombok.demon.co.uk/tapestry4Demo/Inject.html

Shing

Home page : http://www.lombok.demon.co.uk/



--- On Thu, 28/5/09, Ivano Luberti <lube...@archicoop.it> wrote:

> From: Ivano Luberti <lube...@archicoop.it>
> Subject: Re: [Tapestry 4.1] how to get ServletContext inside a service
> To: "Tapestry users" <users@tapestry.apache.org>
> Date: Thursday, 28 May, 2009, 2:54 PM
> Thanks Norman, but I guess you use
> that inside a class that extends
> BasePage as I do.
> But here I have a concrete class that implements
> IEngineService.
> I use it to return a PDF on the response output stream.
> So either I cannot use an abstract class that extends
> BasePage and
> therefore I cannot use the inject/abstract method approach
> or I'm
> missing something in your answer.
> 
> 
> Norman Franke ha scritto:
> > Here is how I do it:
> >
> >
> @InjectObject("service:tapestry.globals.HttpServletRequest")
> > public abstract HttpServletRequest getRequest();
> >
> > public ServletContext getServletContext() {
> >     return
> getRequest().getSession().getServletContext();
> > }
> >
> > Norman Franke
> > Answering Service for Directors, Inc.
> > www.myasd.com
> >
> > On May 27, 2009, at 11:49 AM, Ivano Luberti wrote:
> >
> >> I have implemented a class that Implements
> IEngineService interface.
> >>
> >> I need to get the ServletContext to finally get
> the realPath.
> >>
> >> Anyone can tell me how to do that?
> >>
> >> I have searched for a while without success
> >>
> >>
> >> -- 
> >>
> ==================================================
> >> dott. Ivano Mario Luberti
> >> Archimede Informatica societa' cooperativa a r.
> l.
> >> Sede Operativa
> >> Via Gereschi 36 - 56126- Pisa
> >> tel.: +39-050- 580959
> >> tel/fax: +39-050-9711344
> >> web: www.archicoop.it
> >>
> ==================================================
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> 
> -- 
> ==================================================
> dott. Ivano Mario Luberti
> Archimede Informatica societa' cooperativa a r. l.
> Sede Operativa
> Via Gereschi 36 - 56126- Pisa
> tel.: +39-050- 580959
> tel/fax: +39-050-9711344
> web: www.archicoop.it
> ==================================================
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 


   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to