struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Wyatt" <jwy...@itree.com.au>
Subject RE: Session not set before prepare() function with Struts 2 prepare interceptor
Date Wed, 28 Mar 2007 06:14:55 GMT
Thanks Rohit,  moving the default stack before the prepare was a good idea,
works fine. 

Regards
Jason


-----Original Message-----
From: Rohit Dewan [mailto:dewanr@gmail.com] 
Sent: Wednesday, 28 March 2007 4:01 PM
To: Struts Users Mailing List
Subject: Re: Session not set before prepare() function with Struts 2 prepare
interceptor

Hi Jason,

I believe it is the servlet-config interceptor that is responsible for
setting the session. I think it is part of the defaultStack. Try moving the
defaultStack before prepare in your configuration. That might do the job.

Regards,
Rohit

On 3/27/07, Jason Wyatt <jwyatt@itree.com.au> wrote:
>
>
> Hi,
>
> I'm trying to use the "prepare" interceptor in Struts 2, and although 
> the Action's prepare() function IS being called, the session doesn't 
> seem to be set on the action before the prepare() function is called.
>
> The action implements SessionAware, and has a setSession(Map session) 
> function. The session aware part was working for the execute() function.
>
> Do I need to add another interceptor to the action's interceptor stack 
> before the prepare interceptor?
>
> Here is the Action's interceptor stack:
>
>     <interceptor-stack name="userprep" >
>         <interceptor-ref name="authentication" />
>         <interceptor-ref name="prepare" />
>         <interceptor-ref name="defaultStack"/>
>     </interceptor-stack>
>
> Thanks in advance for any help, regards
>
> Jason
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Itree Software         www.itree.com.au
> Ph (02)42263454        Fax (02)42263193
>         -> Meeting your requirements.
>         -> Delivering on promises.
>         -> Pride in our work.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message