Re: Re: RegexFieldValidator / StringRegexValidator - duplicate
Claus Ibsen <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <24573796.1145268029393.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
Eugene, are you thinking that:
[code]
<#elseif validator.validatorType = "regex">
if (field.value != null && !field.value.match("${validator.expression?js_string}")) {
addError(field, error);
errors = true;
}
<#elseif validator.validatorType = "stringregex">
if (field.value != null && !field.value.match(/${validator.regex}/)) {
addError(field, error);
errors = true;
}
[/code]
Are the same validator?
That we should use regex instead of stringregex?
From the doc in the top of the file we have:
[code]
START SNIPPET: supported-validators
Only the following validators are supported:
* required validator
* requiredstring validator
* stringlength validator
* regex validator
* email validator
* url validator
* int validator
* double validator
END SNIPPET: supported-validators
[/code]
Here stringregex is not mentioned.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=22983&messageID=51619#51619
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]