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/09 00:46:46 UTC

Interceptor doesn't work upon submit?

 Hello All,

In my application I have created a LoginSessionInterceptor.
struts.xml:
<interceptors>
    <interceptor name="log2000" 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 fine when Initially called that assign action(page
renders first time).. But if there is a submit button in that assign_page
which calls a method back in Assign Action class, it validates session in
Interceptor and goes to specific method in Action class with NO request
values(selected values in assign jsp). All action values are null..
here is the code for submit button:
<s:submit value="Assign" name="Assign" method="assignUser"
cssClass="ibutton"/>

Same code works well if there is no interceptor involved.. 
My question is "is Interceptors do carry request values upon form
submission???", How can i resolve this. 
I tried removing assignUser method, and even in execute() method also
doesn't have any values selected...

Any help is appreciated..

Thanks,
Shekar.
-- 
View this message in context: http://www.nabble.com/Interceptor-doesn%27t-work-upon-submit--tp14701913p14701913.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: Interceptor doesn't work upon submit?

Posted by Martin Gainty <mg...@hotmail.com>.
there was a posting earlier in the day on a similar question which asked
inquired as adding the interceptor to your defaultStack the
struts-default.xml defaultStack declaration looks like
       <interceptor-stack name="defaultStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="debugging"/>
                <interceptor-ref name="profiling"/>
                <interceptor-ref name="scoped-model-driven"/>
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param
name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param
name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
            </interceptor-stack>

and then referenced later on with
<interceptor-ref name="defaultStack"/>

M--
----- Original Message -----
From: "styl9090" <st...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Tuesday, January 08, 2008 6:46 PM
Subject: Interceptor doesn't work upon submit?


>
>  Hello All,
>
> In my application I have created a LoginSessionInterceptor.
> struts.xml:
> <interceptors>
>     <interceptor name="log2000" 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 fine when Initially called that assign action(page
> renders first time).. But if there is a submit button in that assign_page
> which calls a method back in Assign Action class, it validates session in
> Interceptor and goes to specific method in Action class with NO request
> values(selected values in assign jsp). All action values are null..
> here is the code for submit button:
> <s:submit value="Assign" name="Assign" method="assignUser"
> cssClass="ibutton"/>
>
> Same code works well if there is no interceptor involved..
> My question is "is Interceptors do carry request values upon form
> submission???", How can i resolve this.
> I tried removing assignUser method, and even in execute() method also
> doesn't have any values selected...
>
> Any help is appreciated..
>
> Thanks,
> Shekar.
> --
> View this message in context:
http://www.nabble.com/Interceptor-doesn%27t-work-upon-submit--tp14701913p147
01913.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
>
>


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


Re: Interceptor doesn't work upon submit?

Posted by styl9090 <st...@yahoo.com>.
Thank you so much...!!!!
It works. :) All I had to create Interceptor will all the values of
defaultStack.
Thanks.


newton.dave wrote:
> 
> Did I not already answer this?
> 
> --- styl9090 <st...@yahoo.com> wrote:
>> <action name="assign" class="***.AssignAction">
>>         <interceptor-ref name="log2000"/>      
>>         <result name="assign">/pages/assign_user.jsp</result>
>> </action>
> 
> You have configured a *single* interceptor to be run for this action.
> 
> If you want the default interceptor stack to be executed you must either
> include it in the action's configuration or create your own interceptor
> stack
> that includes your interceptor.
> 
> d.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Interceptor-doesn%27t-work-upon-submit--tp14701913p14716519.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: Interceptor doesn't work upon submit?

Posted by Dave Newton <ne...@yahoo.com>.
Did I not already answer this?

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

You have configured a *single* interceptor to be run for this action.

If you want the default interceptor stack to be executed you must either
include it in the action's configuration or create your own interceptor stack
that includes your interceptor.

d.


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