You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Asaf Paris Mandoki <as...@gmail.com> on 2007/07/10 13:19:22 UTC

How do we get access to the servlet context from a class that is not an action?

Hi,
I have an action class (A) that uses another class (B). Is there a way
to get access to the servlet context inside B without injecing it
through A?

Thanks in advance
Asaf

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


Re: How do we get access to the servlet context from a class that is not an action?

Posted by Asaf Paris Mandoki <as...@gmail.com>.
Thanks, it worked

On 7/10/07, Ing. Andrea Vettori <ma...@andreavettori.com> wrote:
> You can use
>
> ServletActionContext.getServletContext()
>
>
>
> Il giorno 10/lug/07, alle ore 13:19, Asaf Paris Mandoki ha scritto:
>
> > Hi,
> > I have an action class (A) that uses another class (B). Is there a way
> > to get access to the servlet context inside B without injecing it
> > through A?
> >
> > Thanks in advance
> > Asaf
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> --
> Ing. Andrea Vettori
> Consulente per l'Information Technology
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: How do we get access to the servlet context from a class that is not an action?

Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
You can use

ServletActionContext.getServletContext()



Il giorno 10/lug/07, alle ore 13:19, Asaf Paris Mandoki ha scritto:

> Hi,
> I have an action class (A) that uses another class (B). Is there a way
> to get access to the servlet context inside B without injecing it
> through A?
>
> Thanks in advance
> Asaf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

--
Ing. Andrea Vettori
Consulente per l'Information Technology



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