I am implementing a custom validator. The detail for messages in stored in the resources. Here is an example of a message: Value is required for {0}. {0} should contain the label of the component.
@FacesValidator("customValidator")
public class CustomValidator implements Validator {
@Override
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
if (validatorCondition()) {
String summary = Res.getString("error");
String detail = ... format detail here
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, summary, detail));
}
}
}
How can I format the messaged displayed in the validate method?