input_first.jsp
[code="java"]
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Insert title here
input_fist.jsp
/s:textfield
/s:textfield
/s:submit
/s:form
[/code]
action:
[code="java"]
package com.struts2.action;
import com.struts2.model.Point;
public class ConvertTypeActionFirst {
private Point point ;
public Point getPoint() {
return point;
}
public void setPoint(Point point) {
this.point = point;
}
public String execute(){
System.out.println("..........converter type action first....");
//System.out.println("action point.x"+point.getX()+"action point.y"+point.getY());
return "success";
}
}
[/code]
output_first.jsp
[code="java"]
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Insert title here
Hello Point:
用户名:
[/code]
问题:在Struts2的执行流程的时候,会将request得请求参数放入到ValueStack的Context中,请问我怎样才能在输出页面output_first.jsp里获得context里的值呢,如程序中的userName