the method fidnbyid(Integer) in the Service(一个类名) is not applicable for arguments(int)

/**GeneratedMethods*/privateServiceservice;/***Methodexecute*@parammapping*@paramform... /*
* Generated Methods
*/
private Service service;
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward showInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EditUserForm editUserForm = (EditUserForm) form;// TODO Auto-generated method stub
String id = request.getParameter("id");
Users user=service.findByid(Integer.parseInt(id));
editUserForm.setUsername(user.getUsername());
editUserForm.setOldpassword(user.getPassword());
editUserForm.setId(id);
return mapping.findForward("edit");
}

public ActionForward editUser(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EditUserForm editUserForm = (EditUserForm) form;// TODO Auto-generated method stub
Users user = new Users();
user.setId(Integer.parseInt(editUserForm.getId()));
user.setUsername(editUserForm.getUsername());
user.setPassword(editUserForm.getNewpassword1());
service.modifyUser(user);
return mapping.findForward("success");
}
}

public Users findByid(Integer id){
Users user=usersDao.findById(id);
return user;
}
展开
 我来答
cxzucc
2008-09-03 · TA获得超过1317个赞
知道小有建树答主
回答量:1735
采纳率:79%
帮助的人:586万
展开全部
把参数转成Integer类型的,你这里传的是int类型的
Users user=service.findByid(new Integer(Integer.parseInt(id)));
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式