| 1 |
<!DOCTYPE form-validation PUBLIC |
|---|
| 2 |
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN" |
|---|
| 3 |
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd"> |
|---|
| 4 |
<!-- |
|---|
| 5 |
$Id: validator-rules.xml 159291 2005-03-28 20:19:29Z niallp $ |
|---|
| 6 |
|
|---|
| 7 |
This file contains the default Struts Validator pluggable validator |
|---|
| 8 |
definitions. It should be placed somewhere under /WEB-INF and |
|---|
| 9 |
referenced in the struts-config.xml under the plug-in element |
|---|
| 10 |
for the ValidatorPlugIn. |
|---|
| 11 |
|
|---|
| 12 |
<plug-in className="org.apache.struts.validator.ValidatorPlugIn"> |
|---|
| 13 |
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml, |
|---|
| 14 |
/WEB-INF/validation.xml"/> |
|---|
| 15 |
</plug-in> |
|---|
| 16 |
|
|---|
| 17 |
These are the default error messages associated with |
|---|
| 18 |
each validator defined in this file. They should be |
|---|
| 19 |
added to your projects ApplicationResources.properties |
|---|
| 20 |
file or you can associate new ones by modifying the |
|---|
| 21 |
pluggable validators msg attributes in this file. |
|---|
| 22 |
|
|---|
| 23 |
# Struts Validator Error Messages |
|---|
| 24 |
errors.required={0} is required. |
|---|
| 25 |
errors.minlength={0} can not be less than {1} characters. |
|---|
| 26 |
errors.maxlength={0} can not be greater than {1} characters. |
|---|
| 27 |
errors.invalid={0} is invalid. |
|---|
| 28 |
|
|---|
| 29 |
errors.byte={0} must be a byte. |
|---|
| 30 |
errors.short={0} must be a short. |
|---|
| 31 |
errors.integer={0} must be an integer. |
|---|
| 32 |
errors.long={0} must be a long. |
|---|
| 33 |
errors.float={0} must be a float. |
|---|
| 34 |
errors.double={0} must be a double. |
|---|
| 35 |
|
|---|
| 36 |
errors.date={0} is not a date. |
|---|
| 37 |
errors.range={0} is not in the range {1} through {2}. |
|---|
| 38 |
errors.creditcard={0} is an invalid credit card number. |
|---|
| 39 |
errors.email={0} is an invalid e-mail address. |
|---|
| 40 |
|
|---|
| 41 |
Note: Starting in Struts 1.2.0 the default javascript definitions have |
|---|
| 42 |
been consolidated to commons-validator. The default can be overridden |
|---|
| 43 |
by supplying a <javascript> element with a CDATA section, just as |
|---|
| 44 |
in struts 1.1. |
|---|
| 45 |
|
|---|
| 46 |
--> |
|---|
| 47 |
|
|---|
| 48 |
<form-validation> |
|---|
| 49 |
|
|---|
| 50 |
<global> |
|---|
| 51 |
|
|---|
| 52 |
<validator name="required" |
|---|
| 53 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 54 |
method="validateRequired" |
|---|
| 55 |
methodParams="java.lang.Object, |
|---|
| 56 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 57 |
org.apache.commons.validator.Field, |
|---|
| 58 |
org.apache.struts.action.ActionMessages, |
|---|
| 59 |
org.apache.commons.validator.Validator, |
|---|
| 60 |
javax.servlet.http.HttpServletRequest" |
|---|
| 61 |
msg="errors.required"/> |
|---|
| 62 |
|
|---|
| 63 |
<validator name="requiredif" |
|---|
| 64 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 65 |
method="validateRequiredIf" |
|---|
| 66 |
methodParams="java.lang.Object, |
|---|
| 67 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 68 |
org.apache.commons.validator.Field, |
|---|
| 69 |
org.apache.struts.action.ActionMessages, |
|---|
| 70 |
org.apache.commons.validator.Validator, |
|---|
| 71 |
javax.servlet.http.HttpServletRequest" |
|---|
| 72 |
msg="errors.required"/> |
|---|
| 73 |
|
|---|
| 74 |
<validator name="validwhen" |
|---|
| 75 |
msg="errors.required" |
|---|
| 76 |
classname="org.apache.struts.validator.validwhen.ValidWhen" |
|---|
| 77 |
method="validateValidWhen" |
|---|
| 78 |
methodParams="java.lang.Object, |
|---|
| 79 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 80 |
org.apache.commons.validator.Field, |
|---|
| 81 |
org.apache.struts.action.ActionMessages, |
|---|
| 82 |
org.apache.commons.validator.Validator, |
|---|
| 83 |
javax.servlet.http.HttpServletRequest"/> |
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
<validator name="minlength" |
|---|
| 87 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 88 |
method="validateMinLength" |
|---|
| 89 |
methodParams="java.lang.Object, |
|---|
| 90 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 91 |
org.apache.commons.validator.Field, |
|---|
| 92 |
org.apache.struts.action.ActionMessages, |
|---|
| 93 |
org.apache.commons.validator.Validator, |
|---|
| 94 |
javax.servlet.http.HttpServletRequest" |
|---|
| 95 |
depends="" |
|---|
| 96 |
msg="errors.minlength" |
|---|
| 97 |
jsFunction="org.apache.commons.validator.javascript.validateMinLength"/> |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
<validator name="maxlength" |
|---|
| 101 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 102 |
method="validateMaxLength" |
|---|
| 103 |
methodParams="java.lang.Object, |
|---|
| 104 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 105 |
org.apache.commons.validator.Field, |
|---|
| 106 |
org.apache.struts.action.ActionMessages, |
|---|
| 107 |
org.apache.commons.validator.Validator, |
|---|
| 108 |
javax.servlet.http.HttpServletRequest" |
|---|
| 109 |
depends="" |
|---|
| 110 |
msg="errors.maxlength" |
|---|
| 111 |
jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/> |
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
<validator name="mask" |
|---|
| 116 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 117 |
method="validateMask" |
|---|
| 118 |
methodParams="java.lang.Object, |
|---|
| 119 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 120 |
org.apache.commons.validator.Field, |
|---|
| 121 |
org.apache.struts.action.ActionMessages, |
|---|
| 122 |
org.apache.commons.validator.Validator, |
|---|
| 123 |
javax.servlet.http.HttpServletRequest" |
|---|
| 124 |
depends="" |
|---|
| 125 |
msg="errors.invalid"/> |
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
<validator name="byte" |
|---|
| 129 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 130 |
method="validateByte" |
|---|
| 131 |
methodParams="java.lang.Object, |
|---|
| 132 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 133 |
org.apache.commons.validator.Field, |
|---|
| 134 |
org.apache.struts.action.ActionMessages, |
|---|
| 135 |
org.apache.commons.validator.Validator, |
|---|
| 136 |
javax.servlet.http.HttpServletRequest" |
|---|
| 137 |
depends="" |
|---|
| 138 |
msg="errors.byte" |
|---|
| 139 |
jsFunctionName="ByteValidations"/> |
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
<validator name="short" |
|---|
| 143 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 144 |
method="validateShort" |
|---|
| 145 |
methodParams="java.lang.Object, |
|---|
| 146 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 147 |
org.apache.commons.validator.Field, |
|---|
| 148 |
org.apache.struts.action.ActionMessages, |
|---|
| 149 |
org.apache.commons.validator.Validator, |
|---|
| 150 |
javax.servlet.http.HttpServletRequest" |
|---|
| 151 |
depends="" |
|---|
| 152 |
msg="errors.short" |
|---|
| 153 |
jsFunctionName="ShortValidations"/> |
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
<validator name="integer" |
|---|
| 157 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 158 |
method="validateInteger" |
|---|
| 159 |
methodParams="java.lang.Object, |
|---|
| 160 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 161 |
org.apache.commons.validator.Field, |
|---|
| 162 |
org.apache.struts.action.ActionMessages, |
|---|
| 163 |
org.apache.commons.validator.Validator, |
|---|
| 164 |
javax.servlet.http.HttpServletRequest" |
|---|
| 165 |
depends="" |
|---|
| 166 |
msg="errors.integer" |
|---|
| 167 |
jsFunctionName="IntegerValidations"/> |
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
<validator name="long" |
|---|
| 172 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 173 |
method="validateLong" |
|---|
| 174 |
methodParams="java.lang.Object, |
|---|
| 175 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 176 |
org.apache.commons.validator.Field, |
|---|
| 177 |
org.apache.struts.action.ActionMessages, |
|---|
| 178 |
org.apache.commons.validator.Validator, |
|---|
| 179 |
javax.servlet.http.HttpServletRequest" |
|---|
| 180 |
depends="" |
|---|
| 181 |
msg="errors.long"/> |
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
<validator name="float" |
|---|
| 185 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 186 |
method="validateFloat" |
|---|
| 187 |
methodParams="java.lang.Object, |
|---|
| 188 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 189 |
org.apache.commons.validator.Field, |
|---|
| 190 |
org.apache.struts.action.ActionMessages, |
|---|
| 191 |
org.apache.commons.validator.Validator, |
|---|
| 192 |
javax.servlet.http.HttpServletRequest" |
|---|
| 193 |
depends="" |
|---|
| 194 |
msg="errors.float" |
|---|
| 195 |
jsFunctionName="FloatValidations"/> |
|---|
| 196 |
|
|---|
| 197 |
<validator name="double" |
|---|
| 198 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 199 |
method="validateDouble" |
|---|
| 200 |
methodParams="java.lang.Object, |
|---|
| 201 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 202 |
org.apache.commons.validator.Field, |
|---|
| 203 |
org.apache.struts.action.ActionMessages, |
|---|
| 204 |
org.apache.commons.validator.Validator, |
|---|
| 205 |
javax.servlet.http.HttpServletRequest" |
|---|
| 206 |
depends="" |
|---|
| 207 |
msg="errors.double"/> |
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
<validator name="date" |
|---|
| 211 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 212 |
method="validateDate" |
|---|
| 213 |
methodParams="java.lang.Object, |
|---|
| 214 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 215 |
org.apache.commons.validator.Field, |
|---|
| 216 |
org.apache.struts.action.ActionMessages, |
|---|
| 217 |
org.apache.commons.validator.Validator, |
|---|
| 218 |
javax.servlet.http.HttpServletRequest" |
|---|
| 219 |
depends="" |
|---|
| 220 |
msg="errors.date" |
|---|
| 221 |
jsFunctionName="DateValidations"/> |
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
<validator name="intRange" |
|---|
| 225 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 226 |
method="validateIntRange" |
|---|
| 227 |
methodParams="java.lang.Object, |
|---|
| 228 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 229 |
org.apache.commons.validator.Field, |
|---|
| 230 |
org.apache.struts.action.ActionMessages, |
|---|
| 231 |
org.apache.commons.validator.Validator, |
|---|
| 232 |
javax.servlet.http.HttpServletRequest" |
|---|
| 233 |
depends="integer" |
|---|
| 234 |
msg="errors.range"/> |
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
<validator name="floatRange" |
|---|
| 238 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 239 |
method="validateFloatRange" |
|---|
| 240 |
methodParams="java.lang.Object, |
|---|
| 241 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 242 |
org.apache.commons.validator.Field, |
|---|
| 243 |
org.apache.struts.action.ActionMessages, |
|---|
| 244 |
org.apache.commons.validator.Validator, |
|---|
| 245 |
javax.servlet.http.HttpServletRequest" |
|---|
| 246 |
depends="float" |
|---|
| 247 |
msg="errors.range"/> |
|---|
| 248 |
|
|---|
| 249 |
<validator name="doubleRange" |
|---|
| 250 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 251 |
method="validateDoubleRange" |
|---|
| 252 |
methodParams="java.lang.Object, |
|---|
| 253 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 254 |
org.apache.commons.validator.Field, |
|---|
| 255 |
org.apache.struts.action.ActionMessages, |
|---|
| 256 |
org.apache.commons.validator.Validator, |
|---|
| 257 |
javax.servlet.http.HttpServletRequest" |
|---|
| 258 |
depends="double" |
|---|
| 259 |
msg="errors.range"/> |
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
<validator name="creditCard" |
|---|
| 263 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 264 |
method="validateCreditCard" |
|---|
| 265 |
methodParams="java.lang.Object, |
|---|
| 266 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 267 |
org.apache.commons.validator.Field, |
|---|
| 268 |
org.apache.struts.action.ActionMessages, |
|---|
| 269 |
org.apache.commons.validator.Validator, |
|---|
| 270 |
javax.servlet.http.HttpServletRequest" |
|---|
| 271 |
depends="" |
|---|
| 272 |
msg="errors.creditcard"/> |
|---|
| 273 |
|
|---|
| 274 |
|
|---|
| 275 |
<validator name="email" |
|---|
| 276 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 277 |
method="validateEmail" |
|---|
| 278 |
methodParams="java.lang.Object, |
|---|
| 279 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 280 |
org.apache.commons.validator.Field, |
|---|
| 281 |
org.apache.struts.action.ActionMessages, |
|---|
| 282 |
org.apache.commons.validator.Validator, |
|---|
| 283 |
javax.servlet.http.HttpServletRequest" |
|---|
| 284 |
depends="" |
|---|
| 285 |
msg="errors.email"/> |
|---|
| 286 |
|
|---|
| 287 |
<validator name="url" |
|---|
| 288 |
classname="org.apache.struts.validator.FieldChecks" |
|---|
| 289 |
method="validateUrl" |
|---|
| 290 |
methodParams="java.lang.Object, |
|---|
| 291 |
org.apache.commons.validator.ValidatorAction, |
|---|
| 292 |
org.apache.commons.validator.Field, |
|---|
| 293 |
org.apache.struts.action.ActionMessages, |
|---|
| 294 |
org.apache.commons.validator.Validator, |
|---|
| 295 |
javax.servlet.http.HttpServletRequest" |
|---|
| 296 |
depends="" |
|---|
| 297 |
msg="errors.url"/> |
|---|
| 298 |
|
|---|
| 299 |
<!-- |
|---|
| 300 |
This simply allows struts to include the validateUtilities into a page, it should |
|---|
| 301 |
not be used as a validation rule. |
|---|
| 302 |
--> |
|---|
| 303 |
<validator name="includeJavaScriptUtilities" |
|---|
| 304 |
classname="" |
|---|
| 305 |
method="" |
|---|
| 306 |
methodParams="" |
|---|
| 307 |
depends="" |
|---|
| 308 |
msg="" |
|---|
| 309 |
jsFunction="org.apache.commons.validator.javascript.validateUtilities"/> |
|---|
| 310 |
|
|---|
| 311 |
</global> |
|---|
| 312 |
|
|---|
| 313 |
</form-validation> |
|---|