贴上部分代码:UpdateAction中的
public String execute() throws Exception {
Map session=ActionContext.getContext().getSession();
String username=(String) session.get("username");
     userservice.updateUser(username, password);
     return "success";
}
UserServiceImpl中的:
public void updateUser(String username,String password){
Map session=ActionContext.getContext().getSession(); //获取页面上存的值
String un=(String)session.get("username"); //用户名等于得到的用户名
User u=userdao.findByName(un);
u.setPassword(password);
userdao.update(u);

}
UserDAOImpl中的:
public User findByName(String username){
User loguser = new User();
List<User> userlist =  getHibernateTemplate().find("from User user where user.username like ?",username);
if(userlist!=null &&userlist.size()>0) return (User) userlist.get(0);
return null;
}
请教下哪里错了 应该怎么改?
感激不尽!!!