mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
Merge branch 'upper-case'
This commit is contained in:
@@ -114,13 +114,13 @@ END SNIPPET: supported-validators
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "email">
|
||||
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("${validator.regex?js_string}")==null) {
|
||||
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match(/${validator.regex}/i)==null) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "url">
|
||||
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("/${validator.urlRegex?js_string}/i")==null) {
|
||||
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match(/${validator.urlRegex}/i)==null) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.opensymphony.xwork2.validator.validators.EmailValidator;
|
||||
public class EmailValidatorTest extends XWorkTestCase {
|
||||
|
||||
public void testEmailValidity() throws Exception {
|
||||
assertTrue(verifyEmailValidity("TmJee@Yahoo.com"));
|
||||
assertTrue(verifyEmailValidity("tmjee@yahoo.com"));
|
||||
assertTrue(verifyEmailValidityWithExpression("tmjee@yahoo.com", "\\b^[a-z]+@[a-z]+(\\.[a-z]+)*\\.com$\\b"));
|
||||
assertTrue(verifyEmailValidity("tm_jee@yahoo.co"));
|
||||
|
||||
Reference in New Issue
Block a user