MentaTutorials

Compare Revisions

Regard whitespace Rev 25 → Rev 26

/MentaRefAppWithService/trunk/src/main/java/org/menta/action/LoginAction.java
1,6 → 1,7
package org.menta.action;
 
import org.menta.exception.LoginException;
import org.menta.exception.LoginException.Type;
import org.menta.model.User;
import org.menta.service.UserService;
import org.mentawai.action.BaseLoginAction;
29,15 → 30,19
return SUCCESS;
} catch (LoginException e) {
addError("username", e.getType().toString());
Type type = e.getType();
if (type == Type.WRONG_PASSWORD) {
addError("password", type.toString());
} else {
addError("username", type.toString());
}
return ERROR;
}
}
 
@Override
public void prepareValidator(Validator validator, String innerAction) {
validator.requiredFields("username.password.required", "username","password");
validator.requiredFields("required_field", "username", "password");
}
}
/MentaRefAppWithService/trunk/src/main/java/org/menta/exception/LoginException.java
8,7 → 8,7
private static final long serialVersionUID = 1L;
private final Type type;
 
public enum Type {
public static enum Type {
USERNAME_NOTFOUND,
WRONG_PASSWORD;
}
/MentaRefAppWithService/trunk/src/main/webapp/i18n/master_pt_BR.i18n
7,7 → 7,7
 
LoginAction.USERNAME_NOTFOUND = Apelido inexistente!
LoginAction.WRONG_PASSWORD = Senha incorreta!
LoginAction.username.password.required = Usuário e senha são obrigatórios
LoginAction.required_field = Campo obrigatório!
 
# UserAction
 
/MentaRefAppWithService/trunk/src/main/webapp/i18n/master_en_US.i18n
7,7 → 7,7
 
LoginAction.USERNAME_NOTFOUND = Username unknown!
LoginAction.WRONG_PASSWORD = Incorrect password!
LoginAction.username.password.required = Username and Password are requireds
LoginAction.required_field = Required field!
 
# UserAction