<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
-->
<!DOCTYPE validators PUBLIC
  		"-//Apache Struts//XWork Validator 1.0//EN"
  		"https://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">

<!-- START SNIPPET: fieldValidatorsExample -->

<validators>
	<field name="requiredValidatorField">
		<field-validator type="required">
			<message><![CDATA[ required ]]></message>
		</field-validator>
	</field>
	<field name="requiredStringValidatorField">
		<field-validator type="requiredstring">
			<param name="trim">true</param>
            <message key="i18n.nothing.here"><![CDATA[ required and must be string ]]></message>
		</field-validator>
	</field>
	<field name="requiredStringValidatorField">
		<field-validator type="requiredstring">
			<param name="trim">true</param>
            <message key="i18n.requiredstring"><![CDATA[ required and must be string ]]></message>
		</field-validator>
	</field>
	<field name="integerValidatorField">
		<field-validator type="int">
			<param name="min">1</param>
			<param name="max">10</param>
			<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
		</field-validator>
	</field>
	<field name="dateValidatorField">
		<field-validator type="date">
			<param name="min">01/01/1990</param>
			<param name="max">01/01/2000</param>
			<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
		</field-validator>
	</field>
	<field name="emailValidatorField">
		<field-validator type="email">
			<message><![CDATA[ must be a valid email if supplied ]]></message>
		</field-validator>
	</field>
	<field name="urlValidatorField">
		<field-validator type="url">
			<message><![CDATA[ must be a valid url if supplied ]]></message>
		</field-validator>
	</field>
	<field name="stringLengthValidatorField">
		<field-validator type="stringlength">
			<param name="maxLength">4</param>
			<param name="minLength">2</param>
			<param name="trim">true</param>
			<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
		</field-validator>
	</field>
	<field name="regexValidatorField">
		<field-validator type="regex">
			<param name="regex">.*\.txt</param>
			<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
		</field-validator>
	</field>
	<field name="fieldExpressionValidatorField">
		<field-validator type="fieldexpression">
			<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
			<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
		</field-validator>
	</field>
</validators>

<!-- END SNIPPET: fieldValidatorsExample -->

