You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Be...@mhn.com on 2008/09/17 19:30:06 UTC

[S2] Action chaining and validation problem

Without going into a lot of detail, suffice to say our application benefits
from action chaning, and we are using it in the documented way.

We've begun to go through and add the validation to some actions, but we
have run into a snag with validation and action chaining.

Whenever one action in the chain encounters an error as a result of
validation all other actions are affected.  Struts then calls the input
method on all downstream actions.  However, some actions don't override
input, and by calling only the input method on those actions Struts is not
calling the intended method (be it execute() or a named method), and those
actions are not executing properly.  Not only are downstream actions
affected, but simple actions called using the <s:action tag are also
affected in the same way.

It seems like, whenever there are action errors in the value stack,
everything passed that value stack gets a call to input.

Has anyone else run in to this kind of issue with action chaining and
validation?

Thanks,
-B



---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------

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


RE: [S2] solution - Action chaining and validation problem

Posted by Be...@mhn.com.
The culprit wasn't the validation interceptor, but the workflow
interceptor.  Its only job is to stop the chain (and call input on
everything) when validation errors occur.  I removed it entirely and
everything is working as we need it to.  This worked for us because,
regardless of errors, we need our entire chain to go to completion.

I could have used the excludeMethods parameter, but it would have been * .
(so it was better to remove it entirely)

Thanks for the help,
-B



                                                                           
             Martin Gainty                                                 
             <mgainty@hotmail.                                             
             com>                                                       To 
                                       Struts Users Mailing List           
             09/17/2008 03:55          <us...@struts.apache.org>            
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: [S2] Action chaining and        
               "Struts Users           validation problem                  
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           





1 down ..more to go..have you have declared any methods in excludeMethods
 ?

http://struts.apache.org/2.0.6
/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html


Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: RE: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'Sullivan@mhn.com
> Date: Wed, 17 Sep 2008 15:32:49 -0700
>
> We actually have no validation XML files (we're setting error fields
> manually).  We're not performing validation using that approach, but we
> want to remain open to doing so in the future.   The validation
interceptor
> is in the struts-default stack, which is what our packages extend from.
>
> From what Dave said it sounds like short circuiting is not our solution.
> Is there perhaps a setting we're missing on the chaining interceptor to
> tell it not to call validation/input on downstream chained actions?
>
> I read a similar thread where someone suggested reordering the
interceptor
> stack so that validation is above chain, because when chain is first it
> copies action errors into the next action in the chain.  I've started
> making a custom interceptor stack to try this, but my guess is the action
> that JSP result won't see the action errors from the one action that
*does*
> set action error messages because they won't get copied down the stack.
>
> It seems like the framework is calling input on any downstream chained
> action if action errors are placed on the value stack by an upstream
> chained action.  We even have some actions called via s:action (execute
> results = true) in the JSP result and it's trying to call input even on
> those actions.
>
> -B
>
>
>
>
>

>              Martin Gainty

>              <mgainty@hotmail.

>              com>
To
>                                        Struts Users Mailing List

>              09/17/2008 11:21          <us...@struts.apache.org>

>              AM
cc
>

>
Subject
>              Please respond to         RE: [S2] Action chaining and

>                "Struts Users           validation problem

>                Mailing List"

>              <user@struts.apac

>                   he.org>

>

>

>

>
>
>
>
>
> check  your validators.xml to see if your short-circuit attribute is set
to
> true
> The invokemethod grants the Interceptor the power to short-circuiting the
> Action Invocation.
> Instead of calling invoke, the Interceptor can
> return a result String and
> bypass any remaining Interceptors on the stack and the Action's execute
> method.
> e.g.
>  <validators>
>    <!-- Field Validators for email field -->
>    <field name="email">
>        <field-validator type="required" short-circuit="true">
> you'll want to set short-circuit="false" to allow interceptors and
execute
> to be invoked
>
> http://struts.apache.org/2.x/docs/understanding-interceptors.html
>
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission.
>
>
> > Subject: [S2] Action chaining and validation problem
> > To: user@struts.apache.org
> > From: Becky.L.O'Sullivan@mhn.com
> > Date: Wed, 17 Sep 2008 10:30:06 -0700
> >
> >
> > Without going into a lot of detail, suffice to say our application
> benefits
> > from action chaning, and we are using it in the documented way.
> >
> > We've begun to go through and add the validation to some actions, but
we
> > have run into a snag with validation and action chaining.
> >
> > Whenever one action in the chain encounters an error as a result of
> > validation all other actions are affected.  Struts then calls the input
> > method on all downstream actions.  However, some actions don't override
> > input, and by calling only the input method on those actions Struts is
> not
> > calling the intended method (be it execute() or a named method), and
> those
> > actions are not executing properly.  Not only are downstream actions
> > affected, but simple actions called using the <s:action tag are also
> > affected in the same way.
> >
> > It seems like, whenever there are action errors in the value stack,
> > everything passed that value stack gets a call to input.
> >
> > Has anyone else run in to this kind of issue with action chaining and
> > validation?
> >
> > Thanks,
> > -B
> >
> >
> >
> > ---------------------------------------------------------------------
> > This message, together with any attachments, is
> > intended only for the use of the individual or entity
> > to which it is addressed. It may contain information
> > that is confidential and prohibited from disclosure.
> > If you are not the intended recipient, you are hereby
> > notified that any dissemination or copying of this
> > message or any attachment is strictly prohibited. If
> > you have received this message in error, please notify
> > the original sender immediately by telephone or by
> > return e-mail and delete this message, along with any
> > attachments, from your computer. Thank you.
> >
> > ---------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
>
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

>
> ---------------------------------------------------------------------
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> ---------------------------------------------------------------------

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------

RE: [S2] Action chaining and validation problem

Posted by Be...@mhn.com.
I'm referencing defaultStack.  Can I simply pass that parameter to the
default stack and the validator interceptor will pick it up?
We don't actually use xml-based validation.  We set action errors on our
own.  Do you think it'll still work even though that interceptor is
specifically for xml based validation?

Is there no setting on the chain interceptor to proceed "business as usual"
through all downstream action methods if one encounters an error?

Thanks,
-B






                                                                           
             Martin Gainty                                                 
             <mgainty@hotmail.                                             
             com>                                                       To 
                                       Struts Users Mailing List           
             09/17/2008 03:55          <us...@struts.apache.org>            
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: [S2] Action chaining and        
               "Struts Users           validation problem                  
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           





1 down ..more to go..have you have declared any methods in excludeMethods
 ?

http://struts.apache.org/2.0.6
/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html


Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: RE: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'Sullivan@mhn.com
> Date: Wed, 17 Sep 2008 15:32:49 -0700
>
> We actually have no validation XML files (we're setting error fields
> manually).  We're not performing validation using that approach, but we
> want to remain open to doing so in the future.   The validation
interceptor
> is in the struts-default stack, which is what our packages extend from.
>
> From what Dave said it sounds like short circuiting is not our solution.
> Is there perhaps a setting we're missing on the chaining interceptor to
> tell it not to call validation/input on downstream chained actions?
>
> I read a similar thread where someone suggested reordering the
interceptor
> stack so that validation is above chain, because when chain is first it
> copies action errors into the next action in the chain.  I've started
> making a custom interceptor stack to try this, but my guess is the action
> that JSP result won't see the action errors from the one action that
*does*
> set action error messages because they won't get copied down the stack.
>
> It seems like the framework is calling input on any downstream chained
> action if action errors are placed on the value stack by an upstream
> chained action.  We even have some actions called via s:action (execute
> results = true) in the JSP result and it's trying to call input even on
> those actions.
>
> -B
>
>
>
>
>

>              Martin Gainty

>              <mgainty@hotmail.

>              com>
To
>                                        Struts Users Mailing List

>              09/17/2008 11:21          <us...@struts.apache.org>

>              AM
cc
>

>
Subject
>              Please respond to         RE: [S2] Action chaining and

>                "Struts Users           validation problem

>                Mailing List"

>              <user@struts.apac

>                   he.org>

>

>

>

>
>
>
>
>
> check  your validators.xml to see if your short-circuit attribute is set
to
> true
> The invokemethod grants the Interceptor the power to short-circuiting the
> Action Invocation.
> Instead of calling invoke, the Interceptor can
> return a result String and
> bypass any remaining Interceptors on the stack and the Action's execute
> method.
> e.g.
>  <validators>
>    <!-- Field Validators for email field -->
>    <field name="email">
>        <field-validator type="required" short-circuit="true">
> you'll want to set short-circuit="false" to allow interceptors and
execute
> to be invoked
>
> http://struts.apache.org/2.x/docs/understanding-interceptors.html
>
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission.
>
>
> > Subject: [S2] Action chaining and validation problem
> > To: user@struts.apache.org
> > From: Becky.L.O'Sullivan@mhn.com
> > Date: Wed, 17 Sep 2008 10:30:06 -0700
> >
> >
> > Without going into a lot of detail, suffice to say our application
> benefits
> > from action chaning, and we are using it in the documented way.
> >
> > We've begun to go through and add the validation to some actions, but
we
> > have run into a snag with validation and action chaining.
> >
> > Whenever one action in the chain encounters an error as a result of
> > validation all other actions are affected.  Struts then calls the input
> > method on all downstream actions.  However, some actions don't override
> > input, and by calling only the input method on those actions Struts is
> not
> > calling the intended method (be it execute() or a named method), and
> those
> > actions are not executing properly.  Not only are downstream actions
> > affected, but simple actions called using the <s:action tag are also
> > affected in the same way.
> >
> > It seems like, whenever there are action errors in the value stack,
> > everything passed that value stack gets a call to input.
> >
> > Has anyone else run in to this kind of issue with action chaining and
> > validation?
> >
> > Thanks,
> > -B
> >
> >
> >
> > ---------------------------------------------------------------------
> > This message, together with any attachments, is
> > intended only for the use of the individual or entity
> > to which it is addressed. It may contain information
> > that is confidential and prohibited from disclosure.
> > If you are not the intended recipient, you are hereby
> > notified that any dissemination or copying of this
> > message or any attachment is strictly prohibited. If
> > you have received this message in error, please notify
> > the original sender immediately by telephone or by
> > return e-mail and delete this message, along with any
> > attachments, from your computer. Thank you.
> >
> > ---------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
>
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

>
> ---------------------------------------------------------------------
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> ---------------------------------------------------------------------

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------

RE: [S2] Action chaining and validation problem

Posted by Martin Gainty <mg...@hotmail.com>.
1 down ..more to go..have you have declared any methods in excludeMethods
 ?

http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Subject: RE: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'Sullivan@mhn.com
> Date: Wed, 17 Sep 2008 15:32:49 -0700
> 
> We actually have no validation XML files (we're setting error fields
> manually).  We're not performing validation using that approach, but we
> want to remain open to doing so in the future.   The validation interceptor
> is in the struts-default stack, which is what our packages extend from.
> 
> From what Dave said it sounds like short circuiting is not our solution.
> Is there perhaps a setting we're missing on the chaining interceptor to
> tell it not to call validation/input on downstream chained actions?
> 
> I read a similar thread where someone suggested reordering the interceptor
> stack so that validation is above chain, because when chain is first it
> copies action errors into the next action in the chain.  I've started
> making a custom interceptor stack to try this, but my guess is the action
> that JSP result won't see the action errors from the one action that *does*
> set action error messages because they won't get copied down the stack.
> 
> It seems like the framework is calling input on any downstream chained
> action if action errors are placed on the value stack by an upstream
> chained action.  We even have some actions called via s:action (execute
> results = true) in the JSP result and it's trying to call input even on
> those actions.
> 
> -B
> 
> 
> 
> 
>                                                                            
>              Martin Gainty                                                 
>              <mgainty@hotmail.                                             
>              com>                                                       To 
>                                        Struts Users Mailing List           
>              09/17/2008 11:21          <us...@struts.apache.org>            
>              AM                                                         cc 
>                                                                            
>                                                                    Subject 
>              Please respond to         RE: [S2] Action chaining and        
>                "Struts Users           validation problem                  
>                Mailing List"                                               
>              <user@struts.apac                                             
>                   he.org>                                                  
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> 
> check  your validators.xml to see if your short-circuit attribute is set to
> true
> The invokemethod grants the Interceptor the power to short-circuiting the
> Action Invocation.
> Instead of calling invoke, the Interceptor can
> return a result String and
> bypass any remaining Interceptors on the stack and the Action's execute
> method.
> e.g.
>  <validators>
>    <!-- Field Validators for email field -->
>    <field name="email">
>        <field-validator type="required" short-circuit="true">
> you'll want to set short-circuit="false" to allow interceptors and execute
> to be invoked
> 
> http://struts.apache.org/2.x/docs/understanding-interceptors.html
> 
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission.
> 
> 
> > Subject: [S2] Action chaining and validation problem
> > To: user@struts.apache.org
> > From: Becky.L.O'Sullivan@mhn.com
> > Date: Wed, 17 Sep 2008 10:30:06 -0700
> >
> >
> > Without going into a lot of detail, suffice to say our application
> benefits
> > from action chaning, and we are using it in the documented way.
> >
> > We've begun to go through and add the validation to some actions, but we
> > have run into a snag with validation and action chaining.
> >
> > Whenever one action in the chain encounters an error as a result of
> > validation all other actions are affected.  Struts then calls the input
> > method on all downstream actions.  However, some actions don't override
> > input, and by calling only the input method on those actions Struts is
> not
> > calling the intended method (be it execute() or a named method), and
> those
> > actions are not executing properly.  Not only are downstream actions
> > affected, but simple actions called using the <s:action tag are also
> > affected in the same way.
> >
> > It seems like, whenever there are action errors in the value stack,
> > everything passed that value stack gets a call to input.
> >
> > Has anyone else run in to this kind of issue with action chaining and
> > validation?
> >
> > Thanks,
> > -B
> >
> >
> >
> > ---------------------------------------------------------------------
> > This message, together with any attachments, is
> > intended only for the use of the individual or entity
> > to which it is addressed. It may contain information
> > that is confidential and prohibited from disclosure.
> > If you are not the intended recipient, you are hereby
> > notified that any dissemination or copying of this
> > message or any attachment is strictly prohibited. If
> > you have received this message in error, please notify
> > the original sender immediately by telephone or by
> > return e-mail and delete this message, along with any
> > attachments, from your computer. Thank you.
> >
> > ---------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> 
> _________________________________________________________________
> Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
> http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
> 
> ---------------------------------------------------------------------
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
> 
> ---------------------------------------------------------------------

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

RE: [S2] Action chaining and validation problem

Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 9/17/08, Martin Gainty wrote:
> check  your validators.xml to see if your short-circuit
> attribute is set to true

My understanding is that validation short-circuiting means that additional validations for the same field won't be run as soon as the first validation error is encountered (plus rules for plain vs. field validators).

See http://struts.apache.org/2.x/docs/validation.html#Validation-ShortCircuitingValidator

This won't affect the invocation chain at all. I'd be interesting in clarifying this--where is the documentation that supports what you're saying?

Dave


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


RE: [S2] Action chaining and validation problem

Posted by Be...@mhn.com.
We actually have no validation XML files (we're setting error fields
manually).  We're not performing validation using that approach, but we
want to remain open to doing so in the future.   The validation interceptor
is in the struts-default stack, which is what our packages extend from.

From what Dave said it sounds like short circuiting is not our solution.
Is there perhaps a setting we're missing on the chaining interceptor to
tell it not to call validation/input on downstream chained actions?

I read a similar thread where someone suggested reordering the interceptor
stack so that validation is above chain, because when chain is first it
copies action errors into the next action in the chain.  I've started
making a custom interceptor stack to try this, but my guess is the action
that JSP result won't see the action errors from the one action that *does*
set action error messages because they won't get copied down the stack.

It seems like the framework is calling input on any downstream chained
action if action errors are placed on the value stack by an upstream
chained action.  We even have some actions called via s:action (execute
results = true) in the JSP result and it's trying to call input even on
those actions.

-B




                                                                           
             Martin Gainty                                                 
             <mgainty@hotmail.                                             
             com>                                                       To 
                                       Struts Users Mailing List           
             09/17/2008 11:21          <us...@struts.apache.org>            
             AM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: [S2] Action chaining and        
               "Struts Users           validation problem                  
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           





check  your validators.xml to see if your short-circuit attribute is set to
true
The invokemethod grants the Interceptor the power to short-circuiting the
Action Invocation.
Instead of calling invoke, the Interceptor can
return a result String and
bypass any remaining Interceptors on the stack and the Action's execute
method.
e.g.
 <validators>
   <!-- Field Validators for email field -->
   <field name="email">
       <field-validator type="required" short-circuit="true">
you'll want to set short-circuit="false" to allow interceptors and execute
to be invoked

http://struts.apache.org/2.x/docs/understanding-interceptors.html

Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'Sullivan@mhn.com
> Date: Wed, 17 Sep 2008 10:30:06 -0700
>
>
> Without going into a lot of detail, suffice to say our application
benefits
> from action chaning, and we are using it in the documented way.
>
> We've begun to go through and add the validation to some actions, but we
> have run into a snag with validation and action chaining.
>
> Whenever one action in the chain encounters an error as a result of
> validation all other actions are affected.  Struts then calls the input
> method on all downstream actions.  However, some actions don't override
> input, and by calling only the input method on those actions Struts is
not
> calling the intended method (be it execute() or a named method), and
those
> actions are not executing properly.  Not only are downstream actions
> affected, but simple actions called using the <s:action tag are also
> affected in the same way.
>
> It seems like, whenever there are action errors in the value stack,
> everything passed that value stack gets a call to input.
>
> Has anyone else run in to this kind of issue with action chaining and
> validation?
>
> Thanks,
> -B
>
>
>
> ---------------------------------------------------------------------
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> ---------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------

RE: [S2] Action chaining and validation problem

Posted by Martin Gainty <mg...@hotmail.com>.
check  your validators.xml to see if your short-circuit attribute is set to true
The invokemethod grants the Interceptor the power to short-circuiting the Action Invocation. 
Instead of calling invoke, the Interceptor can 
return a result String and 
bypass any remaining Interceptors on the stack and the Action's execute method.
e.g.
 <validators>
   <!-- Field Validators for email field -->
   <field name="email">
       <field-validator type="required" short-circuit="true">
you'll want to set short-circuit="false" to allow interceptors and execute to be invoked

http://struts.apache.org/2.x/docs/understanding-interceptors.html

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Subject: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'Sullivan@mhn.com
> Date: Wed, 17 Sep 2008 10:30:06 -0700
> 
> 
> Without going into a lot of detail, suffice to say our application benefits
> from action chaning, and we are using it in the documented way.
> 
> We've begun to go through and add the validation to some actions, but we
> have run into a snag with validation and action chaining.
> 
> Whenever one action in the chain encounters an error as a result of
> validation all other actions are affected.  Struts then calls the input
> method on all downstream actions.  However, some actions don't override
> input, and by calling only the input method on those actions Struts is not
> calling the intended method (be it execute() or a named method), and those
> actions are not executing properly.  Not only are downstream actions
> affected, but simple actions called using the <s:action tag are also
> affected in the same way.
> 
> It seems like, whenever there are action errors in the value stack,
> everything passed that value stack gets a call to input.
> 
> Has anyone else run in to this kind of issue with action chaining and
> validation?
> 
> Thanks,
> -B
> 
> 
> 
> ---------------------------------------------------------------------
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
> 
> ---------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008