---
title: "action向其他页面传参数"
author: "netxdiy"
date: "2011-03-19T16:24:35Z"
tags: ["Apache", "JSP", "Struts", "XHTML", "XML"]
categories: ["企业架构"]
slug: "action"
draft: false
lastmod: "2011-03-21T16:15:38Z"
id: 967644
url: "https://netxdiy.iteye.com/blog/967644"
---

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 &lt;%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%&gt; &lt;% String context = request.getContextPath(); %&gt; Insert title here 向结果传参数

1. [传参数](user/user?type=1)

user\_success.jsp &lt;%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%&gt; &lt;%@taglib uri="/struts-tags" prefix="s" %&gt; UserSuccess User Success! from valuestack:  
from actioncontext: