2009-12-30 77 views
0

情況是這樣的。有三頁第1頁,第2頁第3頁Struts 2.0頁面導航

形勢

第1頁>>花費>>第2頁>>花費>>第3頁

第2頁是一箇中間頁,這有鏈接和鏈接包含操作所需的參數以達到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> 

我現在想什麼

我想擺脫2頁,這樣

第1頁>>的花費>>第3頁

我所做的

在struts配置中,我給出了關聯頁面1的動作的結果來鏈接它acti與page2鏈接關聯。

<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> 

問題

現在我該怎樣打發PARAMS與第2頁(這需要你到第3頁)相關聯的操作。 (我經過他們通過鏈接之前)

任何指針將是有益的

回答

2
<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> 

注意page2Param1page2Param2將被傳遞到processPage1AndGoToPage3同樣的方式調用http://server/webapp/processPage1AndGoToPage3.action?page2Param1=page2Value1&page2Param2=page2Value2