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;
} 展开
* 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;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询