全局结果集
全局结果集(Global_Result):
<global-results> <!-- 全局result,在package中可以共用的结果集 -->
<result name="mainpage">/Hello.jsp</result>
</global-results>
//actionpackage com.bjsxt.struts2.user.action;import com.opensymphony.xwork2.ActionSupport;@SuppressWarnings("serial")public class UserAction extends ActionSupport {private int type;public int getType() {return type;}public void setType(int type) {this.type = type;}@Overridepublic String execute() throws Exception {if (type == 1)return "success";else if (type == 2)return "error";elsereturn "mainpage";}}package com.bjsxt.struts2.user.action;import com.opensymphony.xwork2.ActionSupport;@SuppressWarnings("serial")public class AdminAction extends ActionSupport {@Overridepublic String execute() throws Exception {return "mainpage";}}