<action name="actionName" class="com.towerking.TestAction" method="executeMethod"> <result name="success" type="redirect">login.jsp?flag=success&userType=${userType}</result> <result name="error" type="redirect">login.jsp?flag=error&userType=${userType}</result> </action>
在配置Struts2的時候,有時須要配置多個參數,且其中一個參數是根據實際狀況動態變化的,則須要經過上述方法進行配置。jsp
其中在XML文件中,配置 & 須要使用spa
&
不然Struts2會出現以下錯誤:struts2 the reference to entity must end with the ' ;' delimiter。code
在配置代碼中userType的引用值,須要在對應的action中賦值,不然沒法獲取到。blog