コード例 #1
0
 public String changepassword() throws Exception {
   session = ActionContext.getContext().getSession();
   Enterprise enterpise = (Enterprise) session.get("user");
   int id = enterpise.getId();
   String password = enterpriseService.getEnterpriseDAO().findById(id).getPassword();
   System.out.println(password + "---------------------");
   System.out.println(oldpassword + "----------------");
   System.out.println(newpassword + "---------------------");
   System.out.println(temppassword + "---------------------");
   if (!password.equals(oldpassword)) {
     //			System.out.println("old---------------------");
     return "passworderror";
   }
   if (!newpassword.equals(temppassword)) {
     //			System.out.println("new---------------------");
     return "newerror";
   }
   //		System.out.println(enterpise.getEmail());
   enterpriseService.savePassword(enterpise.getId(), newpassword);
   //		System.out.println(enterprise.getId()+"------------------");
   return SUCCESS;
 }