public void setPassword(String password) {
this.password = password;
}
public String register() {
User u = new User();
u.setName(name);
u.setSurname(lastName);
u.setEmail(email);
u.setAge(age);
u.setGender(Gender.valueOf(gender));
u.setLocation(country);
String hashed = SecurityUtils.hash(email, password);
u.setPassword(hashed);
boolean created = dao.createUser(u);
if (!created) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Email is registered already. Try choose another :)"));
}
System.out.println("user created");