Versions Compared

Key

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

...

Code Block
xml
xml

<dependency>
  <groupId>com.github.umeshawasthi</groupId>
  <artifactId>struts2-jsr303-validation-plugin</artifactId>
  <version>1.0</version>
</dependency>

Once plugin is in your application class path, all you need to extends you jsr303 and you will be ready to use JSR303 Validator.

Code Block
xml
xml

<package name="default" extends="jsr303">
    <default-interceptor-ref name="jsr303ValidationStack"/>
    // action mapping
 </package>

Please note that you need to add Bean validator in your application.You can add Hibernate bean Validator or Apache BVal either downloading from there download page or with help of Maven

Hibernate Validator

Code Block
xml
xml

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-validator</artifactId>
   <version>4.3.1.Final</version>
</dependency>

Apache BVal

Code Block
xml
xml

<dependency>
   <groupId>org.apache.geronimo.specs</groupId>
   <artifactId>geronimo-validation_1.0_spec</artifactId>
   <version>1.1</version>
</dependency>
 <dependency>
    <groupId>org.apache.bval</groupId>
     <artifactId>org.apache.bval.bundle</artifactId>
     <version>0.5</version>
 </dependency>