On 3/23/07, Piero Sartini <[EMAIL PROTECTED]> wrote:
> However, I am completely lost with Struts 2. Everything servlet
> dependent is abstracted away "somewhere". I've been looking at the
> tutorials and they don't cover this kind of thing at all.
>
> How do I go about putting the equivalent in an action with Struts 2?

An action class can implement ServletContextAware - you have to implement a
method setServletContext(ServletContext servletContext) then.

Another way is to use ServletActionContext.getServletContext();

Piero


Thanks Piero,

I'm looking at the javadoc for this, it doesn't say much. Do I just
create a class scope variable for the session context and then set
that from the argument in the set method?

Is this set method called automagically by the framework when the
action is first accessed or when the web app is deployed? If I put
this in the base action class and extend that for my other actions,
will this cause problems, or does each final action class need to
implement this?

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to