setAdmin(adminC);
return new ForwardResolution("/WEB-INF/jsp/adminDatePersonale.jsp");
}
public Resolution submitDatePersonale() {
IAdminDao adminDao = new AdminDao();
Admin adminC = getAdmin();
if (adminC.getParola().equals(getParolaVeche())) {
adminDao.saveOrUpdate(adminC);
} else {
byte[] parolaB = adminC.getParola().getBytes();
try {
MessageDigest algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(parolaB);
byte messageDigest[] = algorithm.digest();
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < messageDigest.length; i++) {
hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
}
adminC.setParola(hexString + "");
adminDao.saveOrUpdate(adminC);
} catch (Exception e) {
}
}
return new ForwardResolution("/WEB-INF/jsp/adminDatePersonale.jsp");
}