You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wu Ming <rd...@gmail.com> on 2012/11/25 12:07:19 UTC

What is the effect of Params Interceptor?

I read this tutorial<http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
but I don't understand what Params Interceptor is used for?

Example:

<action name="someAction" class="com.examples.SomeAction">
    <interceptor-ref name="params"/>
    <result name="success">result.jsp</result>
</action>


If the timer interceptor being used, we will see this kind of message:

*INFO: Executed action [//hello!execute] took 109 ms.*


But what about params interceptor? What would happened if it's used? I
tried and don't see anything.

Re: What is the effect of Params Interceptor?

Posted by Lukasz Lenart <lu...@apache.org>.
2012/11/26 Wu Ming <rd...@gmail.com>:
> Oh, so that means there is no point to define the params interceptor in
> Action mapping (as seen below) because it's included in struts-default.xml?
>
> <action name="someAction" class="com.examples.SomeAction">
>     <interceptor-ref name="params"/>
>     <result name="success">result.jsp</result>
> </action>

Yes, it's pointless :-)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: What is the effect of Params Interceptor?

Posted by Wu Ming <rd...@gmail.com>.
Thanks, that's enlightening.


On Mon, Nov 26, 2012 at 3:41 PM, Maurizio Cucchiara
<mc...@apache.org>wrote:

> On 26 November 2012 09:25, Wu Ming <rd...@gmail.com> wrote:
> >
> > Oh, so that means there is no point to define the params interceptor in
> > Action mapping (as seen below) because it's included in
> struts-default.xml?
> >
> > <action name="someAction" class="com.examples.SomeAction">
> >     <interceptor-ref name="params"/>
> >     <result name="success">result.jsp</result>
> > </action>
> >
> >
> Not exactly, it depends on your extends attribute present on package
> definition:
>
> <package name="...." extends="*****struts-default****" namespace="/">
>
> You can take a look at struts-default declaration at [1]
>
> [1] http://struts.apache.org/2.x/docs/struts-defaultxml.html
>
>
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
> VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara
>
> Maurizio Cucchiara
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: What is the effect of Params Interceptor?

Posted by Maurizio Cucchiara <mc...@apache.org>.
On 26 November 2012 09:25, Wu Ming <rd...@gmail.com> wrote:
>
> Oh, so that means there is no point to define the params interceptor in
> Action mapping (as seen below) because it's included in struts-default.xml?
>
> <action name="someAction" class="com.examples.SomeAction">
>     <interceptor-ref name="params"/>
>     <result name="success">result.jsp</result>
> </action>
>
>
Not exactly, it depends on your extends attribute present on package definition:

<package name="...." extends="*****struts-default****" namespace="/">

You can take a look at struts-default declaration at [1]

[1] http://struts.apache.org/2.x/docs/struts-defaultxml.html


Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara

Maurizio Cucchiara

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


Re: What is the effect of Params Interceptor?

Posted by Wu Ming <rd...@gmail.com>.
Oh, so that means there is no point to define the params interceptor in
Action mapping (as seen below) because it's included in struts-default.xml?

<action name="someAction" class="com.examples.SomeAction">
    <interceptor-ref name="params"/>
    <result name="success">result.jsp</result>
</action>


On Mon, Nov 26, 2012 at 2:13 PM, Chris Pratt <th...@gmail.com>wrote:

> Well, not implicitly, but by default.  It is included in the struts-default
> stack.
>   (*Chris*)
>
>
> On Sun, Nov 25, 2012 at 11:01 PM, Wu Ming <rd...@gmail.com> wrote:
>
> > So is that means struts 2 is using params interceptor implicitly?
> >
> >
> > On Mon, Nov 26, 2012 at 10:12 AM, Chris Pratt <thechrispratt@gmail.com
> > >wrote:
> >
> > > Request parameters refers to the data that is supplied with the GET
> query
> > > string or POST body (typically from form parameters).  And the Params
> > > Interceptor takes those parameters and calls the corresponding mutators
> > on
> > > the Action.
> > >   (*Chris*)
> > >
> > >
> > > On Sun, Nov 25, 2012 at 3:40 AM, Wu Ming <rd...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > Is Request Parameters has same meaning with the Action's property
> field
> > > > (the one with getter/setter) ?
> > > >
> > > > For example:
> > > > http://www.tutorialspoint.com/struts_2/struts_actions.htm
> > > >
> > > > HelloWorldAction has "name" property. Then in index.jsp, there is a
> > form
> > > > that has "name" textfield data that will be sent to the
> > HelloWorldAction
> > > if
> > > > the submit button is clicked. So, in this case, could the "name"
> > > textfield
> > > > data can be called as a Request Parameter if it is being submitted to
> > > > the HelloWorldAction?
> > > >
> > > >
> > > >
> > > > On Sun, Nov 25, 2012 at 6:20 PM, Chris Pratt <
> thechrispratt@gmail.com
> > > > >wrote:
> > > >
> > > > > Params interceptor is used in Injecting the Request Parameters into
> > the
> > > > > Action, either individually or (using the ParameterAware interface)
> > all
> > > > at
> > > > > once.
> > > > >   (*Chris*)
> > > > >
> > > > >
> > > > > On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com>
> > wrote:
> > > > >
> > > > > > I read this tutorial<
> > > > > > http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> > > > > > but I don't understand what Params Interceptor is used for?
> > > > > >
> > > > > > Example:
> > > > > >
> > > > > > <action name="someAction" class="com.examples.SomeAction">
> > > > > >     <interceptor-ref name="params"/>
> > > > > >     <result name="success">result.jsp</result>
> > > > > > </action>
> > > > > >
> > > > > >
> > > > > > If the timer interceptor being used, we will see this kind of
> > > message:
> > > > > >
> > > > > > *INFO: Executed action [//hello!execute] took 109 ms.*
> > > > > >
> > > > > >
> > > > > > But what about params interceptor? What would happened if it's
> > used?
> > > I
> > > > > > tried and don't see anything.
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: What is the effect of Params Interceptor?

Posted by Chris Pratt <th...@gmail.com>.
Well, not implicitly, but by default.  It is included in the struts-default
stack.
  (*Chris*)


On Sun, Nov 25, 2012 at 11:01 PM, Wu Ming <rd...@gmail.com> wrote:

> So is that means struts 2 is using params interceptor implicitly?
>
>
> On Mon, Nov 26, 2012 at 10:12 AM, Chris Pratt <thechrispratt@gmail.com
> >wrote:
>
> > Request parameters refers to the data that is supplied with the GET query
> > string or POST body (typically from form parameters).  And the Params
> > Interceptor takes those parameters and calls the corresponding mutators
> on
> > the Action.
> >   (*Chris*)
> >
> >
> > On Sun, Nov 25, 2012 at 3:40 AM, Wu Ming <rd...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > Is Request Parameters has same meaning with the Action's property field
> > > (the one with getter/setter) ?
> > >
> > > For example:
> > > http://www.tutorialspoint.com/struts_2/struts_actions.htm
> > >
> > > HelloWorldAction has "name" property. Then in index.jsp, there is a
> form
> > > that has "name" textfield data that will be sent to the
> HelloWorldAction
> > if
> > > the submit button is clicked. So, in this case, could the "name"
> > textfield
> > > data can be called as a Request Parameter if it is being submitted to
> > > the HelloWorldAction?
> > >
> > >
> > >
> > > On Sun, Nov 25, 2012 at 6:20 PM, Chris Pratt <thechrispratt@gmail.com
> > > >wrote:
> > >
> > > > Params interceptor is used in Injecting the Request Parameters into
> the
> > > > Action, either individually or (using the ParameterAware interface)
> all
> > > at
> > > > once.
> > > >   (*Chris*)
> > > >
> > > >
> > > > On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com>
> wrote:
> > > >
> > > > > I read this tutorial<
> > > > > http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> > > > > but I don't understand what Params Interceptor is used for?
> > > > >
> > > > > Example:
> > > > >
> > > > > <action name="someAction" class="com.examples.SomeAction">
> > > > >     <interceptor-ref name="params"/>
> > > > >     <result name="success">result.jsp</result>
> > > > > </action>
> > > > >
> > > > >
> > > > > If the timer interceptor being used, we will see this kind of
> > message:
> > > > >
> > > > > *INFO: Executed action [//hello!execute] took 109 ms.*
> > > > >
> > > > >
> > > > > But what about params interceptor? What would happened if it's
> used?
> > I
> > > > > tried and don't see anything.
> > > > >
> > > >
> > >
> >
>

Re: What is the effect of Params Interceptor?

Posted by Wu Ming <rd...@gmail.com>.
So is that means struts 2 is using params interceptor implicitly?


On Mon, Nov 26, 2012 at 10:12 AM, Chris Pratt <th...@gmail.com>wrote:

> Request parameters refers to the data that is supplied with the GET query
> string or POST body (typically from form parameters).  And the Params
> Interceptor takes those parameters and calls the corresponding mutators on
> the Action.
>   (*Chris*)
>
>
> On Sun, Nov 25, 2012 at 3:40 AM, Wu Ming <rd...@gmail.com> wrote:
>
> > Hi,
> >
> > Is Request Parameters has same meaning with the Action's property field
> > (the one with getter/setter) ?
> >
> > For example:
> > http://www.tutorialspoint.com/struts_2/struts_actions.htm
> >
> > HelloWorldAction has "name" property. Then in index.jsp, there is a form
> > that has "name" textfield data that will be sent to the HelloWorldAction
> if
> > the submit button is clicked. So, in this case, could the "name"
> textfield
> > data can be called as a Request Parameter if it is being submitted to
> > the HelloWorldAction?
> >
> >
> >
> > On Sun, Nov 25, 2012 at 6:20 PM, Chris Pratt <thechrispratt@gmail.com
> > >wrote:
> >
> > > Params interceptor is used in Injecting the Request Parameters into the
> > > Action, either individually or (using the ParameterAware interface) all
> > at
> > > once.
> > >   (*Chris*)
> > >
> > >
> > > On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com> wrote:
> > >
> > > > I read this tutorial<
> > > > http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> > > > but I don't understand what Params Interceptor is used for?
> > > >
> > > > Example:
> > > >
> > > > <action name="someAction" class="com.examples.SomeAction">
> > > >     <interceptor-ref name="params"/>
> > > >     <result name="success">result.jsp</result>
> > > > </action>
> > > >
> > > >
> > > > If the timer interceptor being used, we will see this kind of
> message:
> > > >
> > > > *INFO: Executed action [//hello!execute] took 109 ms.*
> > > >
> > > >
> > > > But what about params interceptor? What would happened if it's used?
> I
> > > > tried and don't see anything.
> > > >
> > >
> >
>

答复: Re: What is the effect of Params Interceptor?

Posted by ma...@zte.com.cn.
good.

---------------------------------
毛凯
电话:13550048126
邮件:mao.kai23@zte.com.cn 
---------------------------------

 



Chris Pratt <th...@gmail.com> 
2012-11-26 11:12
请答复 给
"Struts Users Mailing List" <us...@struts.apache.org>


收件人
Struts Users Mailing List <us...@struts.apache.org>
抄送

主题
Re: What is the effect of Params Interceptor?






Request parameters refers to the data that is supplied with the GET query
string or POST body (typically from form parameters).  And the Params
Interceptor takes those parameters and calls the corresponding mutators on
the Action.
  (*Chris*)


On Sun, Nov 25, 2012 at 3:40 AM, Wu Ming <rd...@gmail.com> wrote:

> Hi,
>
> Is Request Parameters has same meaning with the Action's property field
> (the one with getter/setter) ?
>
> For example:
> http://www.tutorialspoint.com/struts_2/struts_actions.htm
>
> HelloWorldAction has "name" property. Then in index.jsp, there is a form
> that has "name" textfield data that will be sent to the HelloWorldAction 
if
> the submit button is clicked. So, in this case, could the "name" 
textfield
> data can be called as a Request Parameter if it is being submitted to
> the HelloWorldAction?
>
>
>
> On Sun, Nov 25, 2012 at 6:20 PM, Chris Pratt <thechrispratt@gmail.com
> >wrote:
>
> > Params interceptor is used in Injecting the Request Parameters into 
the
> > Action, either individually or (using the ParameterAware interface) 
all
> at
> > once.
> >   (*Chris*)
> >
> >
> > On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com> wrote:
> >
> > > I read this tutorial<
> > > http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> > > but I don't understand what Params Interceptor is used for?
> > >
> > > Example:
> > >
> > > <action name="someAction" class="com.examples.SomeAction">
> > >     <interceptor-ref name="params"/>
> > >     <result name="success">result.jsp</result>
> > > </action>
> > >
> > >
> > > If the timer interceptor being used, we will see this kind of 
message:
> > >
> > > *INFO: Executed action [//hello!execute] took 109 ms.*
> > >
> > >
> > > But what about params interceptor? What would happened if it's used? 
I
> > > tried and don't see anything.
> > >
> >
>


--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.

Re: What is the effect of Params Interceptor?

Posted by Chris Pratt <th...@gmail.com>.
Request parameters refers to the data that is supplied with the GET query
string or POST body (typically from form parameters).  And the Params
Interceptor takes those parameters and calls the corresponding mutators on
the Action.
  (*Chris*)


On Sun, Nov 25, 2012 at 3:40 AM, Wu Ming <rd...@gmail.com> wrote:

> Hi,
>
> Is Request Parameters has same meaning with the Action's property field
> (the one with getter/setter) ?
>
> For example:
> http://www.tutorialspoint.com/struts_2/struts_actions.htm
>
> HelloWorldAction has "name" property. Then in index.jsp, there is a form
> that has "name" textfield data that will be sent to the HelloWorldAction if
> the submit button is clicked. So, in this case, could the "name" textfield
> data can be called as a Request Parameter if it is being submitted to
> the HelloWorldAction?
>
>
>
> On Sun, Nov 25, 2012 at 6:20 PM, Chris Pratt <thechrispratt@gmail.com
> >wrote:
>
> > Params interceptor is used in Injecting the Request Parameters into the
> > Action, either individually or (using the ParameterAware interface) all
> at
> > once.
> >   (*Chris*)
> >
> >
> > On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com> wrote:
> >
> > > I read this tutorial<
> > > http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> > > but I don't understand what Params Interceptor is used for?
> > >
> > > Example:
> > >
> > > <action name="someAction" class="com.examples.SomeAction">
> > >     <interceptor-ref name="params"/>
> > >     <result name="success">result.jsp</result>
> > > </action>
> > >
> > >
> > > If the timer interceptor being used, we will see this kind of message:
> > >
> > > *INFO: Executed action [//hello!execute] took 109 ms.*
> > >
> > >
> > > But what about params interceptor? What would happened if it's used? I
> > > tried and don't see anything.
> > >
> >
>

Re: What is the effect of Params Interceptor?

Posted by Wu Ming <rd...@gmail.com>.
Hi,

Is Request Parameters has same meaning with the Action's property field
(the one with getter/setter) ?

For example:
http://www.tutorialspoint.com/struts_2/struts_actions.htm

HelloWorldAction has "name" property. Then in index.jsp, there is a form
that has "name" textfield data that will be sent to the HelloWorldAction if
the submit button is clicked. So, in this case, could the "name" textfield
data can be called as a Request Parameter if it is being submitted to
the HelloWorldAction?



On Sun, Nov 25, 2012 at 6:20 PM, Chris Pratt <th...@gmail.com>wrote:

> Params interceptor is used in Injecting the Request Parameters into the
> Action, either individually or (using the ParameterAware interface) all at
> once.
>   (*Chris*)
>
>
> On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com> wrote:
>
> > I read this tutorial<
> > http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> > but I don't understand what Params Interceptor is used for?
> >
> > Example:
> >
> > <action name="someAction" class="com.examples.SomeAction">
> >     <interceptor-ref name="params"/>
> >     <result name="success">result.jsp</result>
> > </action>
> >
> >
> > If the timer interceptor being used, we will see this kind of message:
> >
> > *INFO: Executed action [//hello!execute] took 109 ms.*
> >
> >
> > But what about params interceptor? What would happened if it's used? I
> > tried and don't see anything.
> >
>

Re: What is the effect of Params Interceptor?

Posted by Chris Pratt <th...@gmail.com>.
Params interceptor is used in Injecting the Request Parameters into the
Action, either individually or (using the ParameterAware interface) all at
once.
  (*Chris*)


On Sun, Nov 25, 2012 at 3:07 AM, Wu Ming <rd...@gmail.com> wrote:

> I read this tutorial<
> http://www.tutorialspoint.com/struts_2/struts_interceptors.htm>,
> but I don't understand what Params Interceptor is used for?
>
> Example:
>
> <action name="someAction" class="com.examples.SomeAction">
>     <interceptor-ref name="params"/>
>     <result name="success">result.jsp</result>
> </action>
>
>
> If the timer interceptor being used, we will see this kind of message:
>
> *INFO: Executed action [//hello!execute] took 109 ms.*
>
>
> But what about params interceptor? What would happened if it's used? I
> tried and don't see anything.
>