You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by styl9090 <st...@yahoo.com> on 2008/01/08 20:28:51 UTC

Using Interceptors, Plz help

Hello All,

I am new to Struts 2. 
In my application I have created a LoginSessionInterceptor, and would like
to use it for all the actions using below code.
In struts.xml
<interceptors>
    	<interceptor name="login2000" class="***.LoginInterceptor" />
</interceptors>
<action name="assign" class="***.AssignAction">
        <interceptor-ref name="log2000"/>       
        <result name="assign">/pages/assign_user.jsp</result>
</action>
The above code works file when Initially called that assign page.. But when
there is a submit button in that assign_page and calls a method back in
Action class, it doesn't work as it has to..
code for submit button:
<s:submit value="Assign" name="Assign" method="assignUser"
cssClass="ibutton"/> 

On click of the above button, it calls the Interceptor properly and
validates login session.. but when it goes to assignUser method of action
class, it looses all the selected form values.. everything is nulll.... same
code works well without interceptors assigned to that action...

Any help is appreciated..

Thanks,
Shekar.
-- 
View this message in context: http://www.nabble.com/Using-Interceptors%2C-Plz-help-tp14696844p14696844.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Using Interceptors, Plz help

Posted by Prajapati Manish Narandas <pr...@sigmainfo.net>.
On 1/9/08, Dave Newton <ne...@yahoo.com> wrote:
>
> --- styl9090 <st...@yahoo.com> wrote:
> > <action name="assign" class="***.AssignAction">
> >         <interceptor-ref name="log2000"/>
> >         <result name="assign">/pages/assign_user.jsp</result>
> > </action>
>
> The above configuration means that *only* the "log2000" interceptor will
> run.
>
> You need to either (a) include the "defaultStack" interceptor ref (or
> whatever stack you're using) or (b) create your own stack that includes
> the
> "log2000" interceptor.
>
> d.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Using Interceptors, Plz help

Posted by Dave Newton <ne...@yahoo.com>.
--- styl9090 <st...@yahoo.com> wrote:
> <action name="assign" class="***.AssignAction">
>         <interceptor-ref name="log2000"/>       
>         <result name="assign">/pages/assign_user.jsp</result>
> </action>

The above configuration means that *only* the "log2000" interceptor will run.

You need to either (a) include the "defaultStack" interceptor ref (or
whatever stack you're using) or (b) create your own stack that includes the
"log2000" interceptor.

d.



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