我的actionForm里面有
private String workexpId;
private TStaff TStaff;
private String startTime;
private String endTime;
private String companyName;
private String headship;
private String state;
我要在JSP页面做TStaff的下拉选项框<td>员工姓名</td>
<td><html:select property="TStaff">
<html:options collection="list" labelProperty="name" property="staffId"/>
</html:select></td>可以打印出来,但是我点提交后,他通过actionForm时候报错,我知道是与actionForm的类型参数不匹配,查了下网上,也没有具体的方法,那样应该怎样设计actionForm呢?最好改JSP吧.在JSP中用了<bean:define/>标签=方法也解决不了,希望高人提供个解决思想.
private String workexpId;
private TStaff TStaff;
private String startTime;
private String endTime;
private String companyName;
private String headship;
private String state;
我要在JSP页面做TStaff的下拉选项框<td>员工姓名</td>
<td><html:select property="TStaff">
<html:options collection="list" labelProperty="name" property="staffId"/>
</html:select></td>可以打印出来,但是我点提交后,他通过actionForm时候报错,我知道是与actionForm的类型参数不匹配,查了下网上,也没有具体的方法,那样应该怎样设计actionForm呢?最好改JSP吧.在JSP中用了<bean:define/>标签=方法也解决不了,希望高人提供个解决思想.
改写form里面的TStaff相关的get set方法。或是
TStaff TStaff;//BTW这个命名不太规范<html:form property="TStaff.属性"/>试试
想犹获取TStaff的时候,在action里用TStaffFindByID这样不会出错,
<tr>
<td>员工姓名</td>
<td><html:select property="TStaff" name="workexp">
<html:options collection="list" labelProperty="name" property="staffId"/>
</html:select></td>
</tr>
怎么修改的时候加了name="workexp"属性他也还是和没加一样,因为刚用HIBERNATE所以发现很多和单用STRUTS不同的地方。用STRUTS一般写的是<html:select property="staffId" name="workexp">但是在HIBERNATE就报错,只能够><html:select property="TStaff" name="workexp">,希望高手解决下,急。