Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Required steps for using ExtVal:

  • Download the required ExtVal jar-files or checkout the Source Code and build it. (details)
  • Add these jar-files to your classpath (manually or via maven)
  • Use the annotations (details)

That's it!

Simple validation

...

  • Add myfaces-extval-core-.jar and myfaces-extval-property-validation-.jar to the classpath
  • Use JPA annotations within the model (e.g.: @Column(nullable = false) -> the field is required)

That's it!
The table below gives an overview of the validations that are generated, based on JPA annotations.

JPA Annotation

Generated validation

@Column

  • Field will be required if nullable == false.
  • If the field is a String and the columns property is set on the @Column annotation, the maximum length of the String will be validated accordingly.

@Basic

Field will be required if optional == false.

@OneToOne

Field will be required if optional == false.

@ManyToOne

Field will be required if optional == false.

@Id

Field will be required.

(A simple demo is available here: demo_000)

...

Since r3 ExtVal uses the concept of constraint aspects for generic validation parameters (in case of bean-validaton validation it's a subset which is called validation payload).

...

  • ViolationSeverity
  • DisableClientSideValidation
  • CaseInsensitive

Mapped Constraint Source

The concept is similar to @JoinValidation. However, this version is more type-save and it is supported by the property- as well as the bean-validation module.

Since both modules support the same syntax you will find further information here.