Author: lukaszlenart Date: Thu Jan 3 10:31:35 2013 New Revision: 1428268 URL: http://svn.apache.org/viewvc?rev=1428268&view=rev Log: WW-3892 adds support to specify expression, caseSensitive and trim params as expressions
Modified: struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl Modified: struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl?rev=1428268&r1=1428267&r2=1428268&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl (original) +++ struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl Thu Jan 3 10:31:35 2013 @@ -85,7 +85,7 @@ END SNIPPET: supported-validators <#if validator.shortCircuit>continueValidation = false;</#if> } <#elseif validator.validatorType = "email"> - if (continueValidation && field.value != null && field.value.length > 0 && field.value.match(/\b^['_a-z0-9-\+]+(\.['_a-z0-9-\+]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx)$\b/gi)==null) { + if (continueValidation && field.value != null && field.value.length > 0 && field.value.match("${validator.expression}")==null) { addError(field, error); errors = true; <#if validator.shortCircuit>continueValidation = false;</#if>