在StudentAction中实例化一个对象private Student studentInfo;public Student getStudentInfo() {
return studentInfo;
}public void setStudentInfo(Student studentInfo) {
this.studentInfo = studentInfo;
}
public String getStudent() throws Exception {
String id = ServletActionContext.getRequest().getParameter("id");Student student = new Student();
student.setId(Integer.parseInt(id));
Student studentInfo = (Student) studentbiz.getStudent(student);
ServletActionContext.getRequest().setAttribute("studentInfo", studentInfo);
return "showInfo";
}
在StudentInfo.jsp中用了三种方式显示都不能出来
<s:textfield name="studentInfo.name" value="#{name}"></s:textfield>
<s:textfield value="#studentInfo.name"></s:textfield>
<s:textfield value="<s:property value='#request.studentInfo.name'/>"></s:textfield>
<s:property value="#request.studentInfo.name"/> 我这样单独显示出来就有值,
为什么放在<s:textfield>标签中出不来列, 求助。。
return studentInfo;
}public void setStudentInfo(Student studentInfo) {
this.studentInfo = studentInfo;
}
public String getStudent() throws Exception {
String id = ServletActionContext.getRequest().getParameter("id");Student student = new Student();
student.setId(Integer.parseInt(id));
Student studentInfo = (Student) studentbiz.getStudent(student);
ServletActionContext.getRequest().setAttribute("studentInfo", studentInfo);
return "showInfo";
}
在StudentInfo.jsp中用了三种方式显示都不能出来
<s:textfield name="studentInfo.name" value="#{name}"></s:textfield>
<s:textfield value="#studentInfo.name"></s:textfield>
<s:textfield value="<s:property value='#request.studentInfo.name'/>"></s:textfield>
<s:property value="#request.studentInfo.name"/> 我这样单独显示出来就有值,
为什么放在<s:textfield>标签中出不来列, 求助。。
<s:textfield name="studentInfo.name" value="${studentInfo.name}"></s:textfield>
[/code:]
试试