You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kilmer, Erich" <Er...@mmt.bellhowell.com> on 2001/09/28 20:40:33 UTC

Is there any way in my Action class's perform method to get the s ervlet context?

Is there any way in my Action class's perform method to get the servlet
context?
>From my perform method I call into some access beans that wrap an EJB layer.
We have multiple web apps each with their own database, so the access beans
needs a context to pass onto the EJB layer so that the proper data source is
accessed.
I can't seem to find a way to get servlet context from the request or the
session. I can get it from the servlet config but I don't know how to access
it in the Action perform.
Anything in the AccessMap?
Thanks for the help!
Erich Kilmer
Bell+Howell
RTP, NC



Re: Is there any way in my Action class's perform method to get the servlet context?

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
The Action base class has a 'servlet' member variable that is accessible in
Action subclasses.

    Erik


----- Original Message -----
From: "Kilmer, Erich" <Er...@mmt.bellhowell.com>
To: <st...@jakarta.apache.org>
Sent: Friday, September 28, 2001 11:40 AM
Subject: Is there any way in my Action class's perform method to get the
servlet context?


> Is there any way in my Action class's perform method to get the servlet
> context?
> >From my perform method I call into some access beans that wrap an EJB
layer.
> We have multiple web apps each with their own database, so the access
beans
> needs a context to pass onto the EJB layer so that the proper data source
is
> accessed.
> I can't seem to find a way to get servlet context from the request or the
> session. I can get it from the servlet config but I don't know how to
access
> it in the Action perform.
> Anything in the AccessMap?
> Thanks for the help!
> Erich Kilmer
> Bell+Howell
> RTP, NC
>
>
>