You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhaarat Sharma <bh...@gmail.com> on 2009/07/03 21:24:59 UTC

how to add parameters to result type

I have a simple result type like the following

<action name="Verification" class="gaction.reports.Verification">
        <result>/thirdpartyincome/pendingVerification.jsp</result>
    </action>

how can i add parameters to this resulttype? and have values of parameters
come from my action class?

for example when result type is 'redirect-action' then we can do something
like this

          <result name="success" type="redirect-action">
            <param name="actionName">Information</param>
            <param name= "pageIndex">${pageIndex}</param>
            <param name= "PageSize">50</param>
            <param name= "Value">${phaValue}</param>
          </result>

Re: how to add parameters to result type

Posted by Greg Lindholm <gr...@gmail.com>.
Passing parameters to a JSP page doesn't make any sense. Your JSP page has
access to all your Action properties (that have getters) with the struts
tags (or even with EL syntax).  To get the "month" from your action just use
<s:property value="month" /> in your JSP (assuming you have a getMonth()
method in the action).

The syntax you are using will pass the parameters to the Dispatcher Result
type (

org.apache.struts2.dispatcher.ServletDispatcherResult

not to the JSP page) and if Dispatcher isn't expecting the parameter it
isn't going to do anything with it.


On Mon, Jul 6, 2009 at 1:58 PM, Bhaarat Sharma <bh...@gmail.com> wrote:

> following the documentation on this page:
> http://struts.apache.org/2.x/docs/result-configuration.html
> <http://struts.apache.org/2.x/docs/result-configuration.html>I tried
> something like this
>        <result name="success_pagination" type="dispatcher">
>            <param
> name="location">/reports/identity/identitreport.jsp</param>
>            <param name="pageIndex">${pageIndex}</param>
>            <param name="phaPageSize">${phaPageSize}</param>
>            <param name="goToTab">${goToTab}</param>
>            <param name="Code">${code}</param>
>            <param name="Type">${type}</param>
>            <param name="month">${month}</param>
>        </result>
>
>
> but the parameters are still not getting passed to the page...
>
>
> On Fri, Jul 3, 2009 at 10:53 PM, Dave Newton <ne...@yahoo.com>
> wrote:
>
> > Bhaarat Sharma wrote:
> >
> >> I have a simple result type like the following
> >>
> >> <action name="Verification" class="gaction.reports.Verification">
> >>        <result>/thirdpartyincome/pendingVerification.jsp</result>
> >>    </action>
> >>
> >> how can i add parameters to this resulttype? and have values of
> parameters
> >> come from my action class?
> >>
> >> for example when result type is 'redirect-action' then we can do
> something
> >> like this
> >>
> >>          <result name="success" type="redirect-action">
> >>            <param name="actionName">Information</param>
> >>            <param name= "pageIndex">${pageIndex}</param>
> >>            <param name= "PageSize">50</param>
> >>            <param name= "Value">${phaValue}</param>
> >>          </result>
> >>
> >>
> > According to the documentation you can:
> >
> > http://struts.apache.org/2.x/docs/result-configuration.html
> >
> http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: how to add parameters to result type

Posted by Bhaarat Sharma <bh...@gmail.com>.
following the documentation on this page:
http://struts.apache.org/2.x/docs/result-configuration.html
<http://struts.apache.org/2.x/docs/result-configuration.html>I tried
something like this
        <result name="success_pagination" type="dispatcher">
            <param
name="location">/reports/identity/identitreport.jsp</param>
            <param name="pageIndex">${pageIndex}</param>
            <param name="phaPageSize">${phaPageSize}</param>
            <param name="goToTab">${goToTab}</param>
            <param name="Code">${code}</param>
            <param name="Type">${type}</param>
            <param name="month">${month}</param>
        </result>


but the parameters are still not getting passed to the page...


On Fri, Jul 3, 2009 at 10:53 PM, Dave Newton <ne...@yahoo.com> wrote:

> Bhaarat Sharma wrote:
>
>> I have a simple result type like the following
>>
>> <action name="Verification" class="gaction.reports.Verification">
>>        <result>/thirdpartyincome/pendingVerification.jsp</result>
>>    </action>
>>
>> how can i add parameters to this resulttype? and have values of parameters
>> come from my action class?
>>
>> for example when result type is 'redirect-action' then we can do something
>> like this
>>
>>          <result name="success" type="redirect-action">
>>            <param name="actionName">Information</param>
>>            <param name= "pageIndex">${pageIndex}</param>
>>            <param name= "PageSize">50</param>
>>            <param name= "Value">${phaValue}</param>
>>          </result>
>>
>>
> According to the documentation you can:
>
> http://struts.apache.org/2.x/docs/result-configuration.html
> http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: how to add parameters to result type

Posted by Dave Newton <ne...@yahoo.com>.
Bhaarat Sharma wrote:
> I have a simple result type like the following
> 
> <action name="Verification" class="gaction.reports.Verification">
>         <result>/thirdpartyincome/pendingVerification.jsp</result>
>     </action>
> 
> how can i add parameters to this resulttype? and have values of parameters
> come from my action class?
> 
> for example when result type is 'redirect-action' then we can do something
> like this
> 
>           <result name="success" type="redirect-action">
>             <param name="actionName">Information</param>
>             <param name= "pageIndex">${pageIndex}</param>
>             <param name= "PageSize">50</param>
>             <param name= "Value">${phaValue}</param>
>           </result>
> 

According to the documentation you can:

http://struts.apache.org/2.x/docs/result-configuration.html
http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html

Dave

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