引用:http://shidu.blogbus.com/logs/2004/12/540365.html
配置文件大概如下:
<action-mappings>
<action path="/account"
name="accountForm"
parameter="action"
scope="request"
type="com.ai.uaap.admin.web.action.AccountAction">
<forward name="listOK" path="/AccountMaster.jsp" />
<forward name="removeOK" path="/account.do?action=list" redirect="true" />
</action>
我在執行完remove的方法之后的代碼是return mapping.findForward("removeOK")。這時就會訪問account.do?action=list這個地址,以前我想在account.do?action=list之后繼續添加參數(例如account.do?action=list&abc=123)不知道該怎么實現。
今天看到一個資料給出了實現:
String path = mapping.findForward("removeOK").getPath();
ActionForward forward = new ActionForward(path + "&abc=123", true);
//這里的true是Redirect
return forward;