Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note that there is no JSF validator in the page.

The sample bean

Image Removed

Code Block
java
java
titleFragment of the HelloWorldController bean
public class HelloWorldController {
    
    @Required
    private String name;

    // getters and setters omitted for brevity
}

The result


As you can see, the field is not valid, as the @Required annotation causes the field to be required.

Cross validation

Code Block
java
java
titleUsage of cross validation
public class Person
{
    @NotEquals("lastName")
    private String firstName;

    private String lastName;
...
}

...