Colegas,
Preciso setar o locale default da minha aplicação para pt_BR. Então criei essas linhas no meu faces-config.xml, porém não funciona, pois no método abaixo o locale é en_US.
Como eu seto o locale default para pt_BR?
Obrigado,
Marques
<application>
<message-bundle>br.com.fit.utils.MessageBundle</message-bundle>
<locale-config>
<default-locale>pt_BR</default-locale>
<supported-locale>pt_BR</supported-locale>
<supported-locale>en_US</supported-locale>
</locale-config>
</application>
public void validate(FacesContext facesContext,
UIComponent uIComponent, Object object) throws ValidatorException {
String enteredEmail = (String) object;
//Set the email pattern string
Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
//Match the given string with the pattern
Matcher m = p.matcher(enteredEmail);
//Check whether match is found
boolean matchFound = m.matches();
String text = MessageBundleUtils.getMessageResourceString(facesContext.getApplication()
.getMessageBundle(), INVALID_EMAIL_ID, null, facesContext.getViewRoot()
.getLocale());
if (!matchFound) {
FacesMessage message = new FacesMessage();
message.setDetail(text);
message.setSummary(text);
message.setSeverity(FacesMessage.SEVERITY_ERROR);
throw new ValidatorException(message);
}
}