Param Validation with Annotations.

Splash Forums Rewrite Users Param Validation with Annotations.

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 7 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #26227


    Hi All,
    I am using the pretty faces annotations with this I would like to validate the query param values.
    My configuration is as follows.
    My Url is /test?issue=24542jsda
    For query param:
    Private Integer issue;
    For Validator class:
    @FacesValidator(“issuevalidate “)
    public class IssueValidator implements Validator{

    public void validate(FacesContext context, UIComponent component,
    Object obj) throws ValidatorException {
    FacesMessage message = new FacesMessage();
    throw new ValidatorException(message);


    This validation is triggering only when the correct value is given in the url.
    If the user changes in the url for eg: issue is 1 to hgsad like this,
    then the validation should be triggered, but it is not.
    Could any one of you pls help me
    Could you pls provide the detail example for this.


    If I remember correctly, PrettyFaces will first try to convert the query parameter value into the required target type before calling the validator. As something like 213gsdfgsd cannot be converted to an integer, the validation fails before your validator is called.

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.