how to add parameters to result type

View: New views
4 Messages — Rating Filter:   Alert me  

how to add parameters to result type

by omnipresent :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

by newton.dave :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
For additional commands, e-mail: user-help@...


Re: how to add parameters to result type

by omnipresent :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <newton.dave@...> 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@...
> For additional commands, e-mail: user-help@...
>
>

Re: how to add parameters to result type

by Greg Lindholm-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <bhaarat.s@...> 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 <newton.dave@...>
> 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@...
> > For additional commands, e-mail: user-help@...
> >
> >
>