标签:servlet type 方式 ssi order string rms attr classname
/** * 生成订单 */ @Action(value="add", className="orderAction", results={ @Result(type="redirectAction", params={"actionName", "view", "oid", "%{oid}"}), @Result(name="input", location="/WEB-INF/jsp/msg.jsp"), @Result(name="login", location="/WEB-INF/jsp/login.jsp") }) public String add() { HttpSession session = ServletActionContext.getRequest().getSession(); Cart cart = (Cart)session.getAttribute(CartAction.SESSION_CART); User user = (User)session.getAttribute(UserAction.SESSION_USER); if(cart == null) { getValueStack().set("errMsg", "购物车为空");; return INPUT; } if(user == null) { getValueStack().set("errMsg", "请先登录"); return "login"; } String oid = os.add(getOrder(cart, user)); getValueStack().set("oid", oid); return SUCCESS; }
Struts2 注解方式@Result传递参数给其他Action
标签:servlet type 方式 ssi order string rms attr classname
原文地址:http://www.cnblogs.com/ilovezihan/p/7351137.html