Home > Guides > Core Developers Guide > Validation > Using Field Validators |

Apache Struts 2 Documentation
Using Field Validators
Edit Page Browse Space Add Page Add News

## Description

The followings show a simple example using Struts' Field Validators

### Step 1

Create the jsp page{snippet:id=fieldValidatorsExample|lang=xml|javadoc=false|url=struts2/apps/showcase/src/main/webapp/WEB-INF/validation/fieldValidatorsExample.jsp}

### Step 2

Create the action class{snippet:id=fieldValidatorsExample|javadoc=false|lang=java|url=struts2/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/FieldValidatorsExampleAction.java}

### Step 3

Create the validator.xml.{snippet:id=fieldValidatorsExample|javadoc=false|lang=xml|url=struts2/apps/showcase/src/main/resources/org/apache/struts2/showcase/validation/FieldValidatorsExampleAction-submitFieldValidatorsExamples-validation.xml}