81,091
社区成员
发帖
与我相关
我的任务
分享
<many-to-one name="relation" class="com.product.entity.Relation" cascade="save-update">
<column name="u_relation" />
并且在update.jsp中加入了一个<html:hidden property="user.group"/>
的cascadi属性,可是还是不行,抛得异常为:java.lang.IllegalArgumentException: Cannot invoke com.product.entity.Users.setRelation - argument type mismatch<html:hidden property="user.group"/>
去掉的话
public ActionForward toEdit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
UserForm userForm =(UserForm) form;
String sid=request.getParameter("id");
int id=Integer.parseInt(sid);
Users user=this.userBiz.findUserById(id);
userForm.setUser(user);
return new ActionForward("/WEB-INF/user/update.jsp");
}
public ActionForward doEdit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
UserForm userForm =(UserForm) form;
Users user=userForm.getUser();
this.userBiz.updateUser(user);
try {
response.sendRedirect("user.do?op=doIvalid");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;