You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shinobi <ha...@yahoo.com> on 2012/03/23 15:04:10 UTC

Convention plugin: How do I have two methods on the same action using 2 different Interceptor stacks

I am using struts 2.3.1.2

I have an action class called Students with 2 methods, list and save. 

Using the convention plugin and bang notation, I want the interceptor stack
'basicStack' to fire for method list and the interceptor stack
'paramsPrepareParamsStack' to fire for save. 

Is this possible please?

--
View this message in context: http://struts.1045723.n5.nabble.com/Convention-plugin-How-do-I-have-two-methods-on-the-same-action-using-2-different-Interceptor-stacks-tp5589550p5589550.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: Convention plugin: How do I have two methods on the same action using 2 different Interceptor stacks

Posted by Shinobi <ha...@yahoo.com>.
I want the action name to be the same for both and use bang notation to
select the method to call. If I add the Action annotation with
interceptorRefs as you say and omit the action name it complains that the
action name is the same. Am I doing something wrong or is this just not
possible? 

--
View this message in context: http://struts.1045723.n5.nabble.com/Convention-plugin-How-do-I-have-two-methods-on-the-same-action-using-2-different-Interceptor-stacks-tp5589550p5600108.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: Convention plugin: How do I have two methods on the same action using 2 different Interceptor stacks

Posted by Shrinivas Parashar <Sh...@symantec.com>.
You can apply specific interceptor stack for the action using interceptorRef annotations.
For ex. Put the below annotation above the method for which you want to apply paramsPrepareParamsStack stack,
@Action(value="action1", interceptorRefs=@InterceptorRef("paramsPrepareParamsStack "))

For more details refer to http://struts.apache.org/2.2.3/docs/convention-plugin.html#ConventionPlugin-InterceptorRefannotation



-----Original Message-----
From: Shinobi [mailto:harlander3000@yahoo.com] 
Sent: 23 March 2012 19:34
To: user@struts.apache.org
Subject: Convention plugin: How do I have two methods on the same action using 2 different Interceptor stacks

I am using struts 2.3.1.2

I have an action class called Students with 2 methods, list and save. 

Using the convention plugin and bang notation, I want the interceptor stack
'basicStack' to fire for method list and the interceptor stack
'paramsPrepareParamsStack' to fire for save. 

Is this possible please?

--
View this message in context: http://struts.1045723.n5.nabble.com/Convention-plugin-How-do-I-have-two-methods-on-the-same-action-using-2-different-Interceptor-stacks-tp5589550p5589550.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