action向其他页面传参数
struts.xml /user_success.jsp?t=${type} UserAction.java package com.bjsxt.struts2.user.action; import com.opensymphony.xwork2.ActionSupport; public class UserAction extends ActionSupport { private int type; public int getType() { return type; } public void setType(int type) { this.type = type; } @Override public String execute() throws Exception { return "success"; } } index.jsp <%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%> <% String context = request.getContextPath(); %> Insert title here 向结果传参数
user_success.jsp <%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%> <%@taglib uri="/struts-tags" prefix="s" %> UserSuccess User Success! from valuestack:
from actioncontext: