showDetail="true" => "javax.faces.component.UIInput.REQUIRED_detail"
showSummary="true" => "javax.faces.component.UIInput.REQUIRED"
For example
<h:message for="lastName" errorClass="errorClass"Default, showDetail="true", showSummary="false".
showSummary="true" showDetail="false"/>
Look up Convention
<h:inputText ... required="true" ..."/>Message for custom converter
javax.faces.component.UIInput.REQUIRED
This is message for converter.
javax.faces.converter.IntegerConverter.INTEGER
This is message for validator
javax.faces.validator.LengthValidator.MINIMUM
public class xxxConverter implements Converter {
public Object getAsObject(FacesContext facesContext, UIComponent component,
String value) {
//validation
if ( ... ) {
throw new ConverterException(new FacesMessage(
FacesMessage.SEVERITY_ERROR, "summary message", "detail message"));
}
...
}
...
Message for custom validator
public class xxxValidator implements Validator {
public void validate(FacesContext context,
UIComponent component,
Object obj)
throws ValidatorException {
//validation
if(...)
throw new ValidatorException(new FacesMessage(
FacesMessage.SEVERITY_ERROR,
"summary message", "detail message"));
}...
}
}
No comments:
Post a Comment