页面显示错误:
控制台显示错误:
formBean:
private CRecruitment crecruitment=new CRecruitment(); public CRecruitment getCrecruitment() { return crecruitment; } public void setCrecruitment(CRecruitment recruitment) { crecruitment = recruitment; }
hibernate 映射:
CRecruitment:
<many-to-one name="cposition" class="com.igolf.entity.CPosition" fetch="join" cascade="all" lazy="false"> <column name="POSITION_ID" /> </many-to-one>
CPosition:
<set name="crecruitments" inverse="true" lazy="false" cascade="all"> <key> <column name="POSITION_ID" /> </key> <one-to-many class="com.igolf.entity.CRecruitment" /> </set>
form 已经注入
jsp页面代码是:
<p class="first"> <label> 编号:</label> <input type="text" name="crecruitment.id" size="30" readonly="readonly" value="${crecruitment.id }"/> </p> <p> <label>职位名称:</label> <input type="text" name="crecruitment.cposition.id" size="30" value="${crecruitment.cposition.position }"/> <!-- <select name="crecruitment.cposition.id" > <c:forEach items="${cposition}" var="xx"> <option selected="selected" value="${ xx.id }">${xx.position}</option> </c:forEach> </select>--> </p> <p> <label>发布日期:</label> <input type="text" name="crecruitment.date" size="30" value="${crecruitment.date }"/> * </p>
执行的操作时要保存信息,好久没写了,不知道是不是hibernate多对一的配置问题!