tags:

views:

76

answers:

1

The situation is something like this. There are three pages page1,page2,page 3

Situation

Page1 >> takes to >> Page 2 >> takes to >> Page 3

Page 2 is an intermediate page, which has links and links contains the params required by the action to reach page3.

<a href="<s:url action="gotoPage3" includeParams="none">
    <s:param name="request.accountId"><s:property value="#parameters['accountFrom.accountId']"/></s:param>
    <s:param name="request.accountFromId"><s:property value="#parameters['accountFrom.accountId']"/></s:param>
</a>

What i want now

I want to get rid of page 2 so that

page1 >> takes to >> page 3

What I did

In the struts config, I gave the outcome of action associated page1 to chain it action associated with the page2 link.

<action name="processPage1AndGoToPage3" class="dominos" method="processPage1AndGoToPage3">
    <interceptor-ref name="out-of-office-interceptor"/>
    <interceptor-ref name="paramsPrepareParamsStack"/>
    <interceptor-ref name="remove-hibernate-filters-interceptor"/>
    <interceptor-ref name="request-deleted-interceptor"/>
    <result name="success" type="chain">gotopage3</result>
</action>

Problem

Now how do i pass the params to the action associated with the page2 (which takes you to the page 3). (I was passing them through link before)

Any pointer will be helpful

+1  A: 
<action name="processPage1AndGoToPage3" class="dominos" method="processPage1AndGoToPage3">
    <interceptor-ref name="out-of-office-interceptor"/>
    <interceptor-ref name="paramsPrepareParamsStack"/>
    <interceptor-ref name="remove-hibernate-filters-interceptor"/>
    <interceptor-ref name="request-deleted-interceptor"/>
    <result name="success" type="chain">gotopage3</result>
    <s:param name="page2Param1" value="page2Value1"/>
    <s:param name="page2Param2" value="page2Value2"/>
</action>

Note that page2Param1 and page2Param2 will be passed to processPage1AndGoToPage3 the same way as calling http://server/webapp/processPage1AndGoToPage3.action?page2Param1=page2Value1&amp;page2Param2=page2Value2

tevch