ITeye博客

action向其他页面传参数

netxdiy · 2011-03-19 16:24 · struts2 · 企业架构 · Apache · Struts · XML · JSP · XHTML · Markdown

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 向结果传参数

  1. 传参数

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:

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。