别着急!兄弟 假设数据库中有名为'Person'的Table,对应有名为Person的VO(Value Object). 1.在ActionForm中:Person person = new Person(); (别忘记 get & set方法) 2.在Action中调用BO(Business Object)中的方法获得一条满足条件的VO(T_Person数据库记录),将该Person VO 放入ActionForm中. 3.在jsp页面中<html:text property="person.VO属性名"/>,即可将VO中属性值绑定到form 中.
假设数据库中有名为'Person'的Table,对应有名为Person的VO(Value Object).
1.在ActionForm中:Person person = new Person(); (别忘记 get & set方法)
2.在Action中调用BO(Business Object)中的方法获得一条满足条件的VO(T_Person数据库记录),将该Person VO 放入ActionForm中.
3.在jsp页面中<html:text property="person.VO属性名"/>,即可将VO中属性值绑定到form
中.
1、比如在你的jsp页面里有这样一个一句:
<td><input name="a0" type="text" value="<%=s%>"></td>
2、你通过form(例如你的AbcForm)来传这个值,AbcForm里的代码如下:
private String a0 = null; public String getA0() { return ( ( this.a0 == null ) ? "" : this.a0 );
} public void setA0(String s) { this.a0 = s;
}
3、AbcAction里取得这个值的代码如下: String a0 = ((AbcForm)form).getA0().trim();这样你就可以在AbcForm里来用这个值了。
String a0 = request.getParameter("a0");
来取得这个值