首页 > 编程 > JSP > 正文

Struts中实体类的字段名称要对应jsp中textfield中name属性值

2019-11-06 06:07:26
字体:
来源:转载
供稿:网友

例子:

PRivate String id;	private String firstName;	private String middleInitial;	private String lastName;	private String street;	private String city;	private String state;	private String zip;	private String phone;	private String email;

   和下面的jsp文件中的 name的值要一样

                                      <tr><td><s:textfield name="id" label="编号"></s:textfield></td></tr>                                     <tr><td><s:textfield name="firstName" label="客户姓"></s:textfield></td></tr>                                     <tr><td><s:textfield maxlenght="1" name="middleInitial" label="中间缩写"></s:textfield></td></tr>                                     <tr><td><s:textfield name="lastName" label="客户名"></s:textfield></td></tr>                                     <tr><td><s:textfield name="street" label="街道"></s:textfield></td></tr>                                     <tr><td><s:textfield name="city" label="城市"></s:textfield></td></tr>                                     <tr><td><s:textfield maxlenght="2" name="state" label="省份简写"></s:textfield></td></tr>                                     <tr><td><s:textfield name="zip" label="区号"></s:textfield></td></tr>                                     <tr><td><s:textfield name="phone" label="电话"></s:textfield></td></tr>                                     <tr><td><s:textfield name="email" label="Email"></s:textfield></td></tr>


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表