Hi All, I have a question on the struts validation framework. As i am using the email rule to validate the email. When i am put firstname.lastname@example.org in the email field on the JSP then email rule of the validation framework , correctly validate the email id but when i put �email@example.com ( � is a special character) in the email field on the JSP then this email get failed.
As i checked in the code of the validation framework, in the code email can check character from in between ^[\\000-\\177] range , and it may possible that � has character value than 177 .
So can we handle the email id that contains the characters whose value are greater than 177.
Is there any plugin that support of special characters in the email id
If you'd like to define your own rules for validating an email address, I'd suggest using the mask validation rule. With this rule, you can match the input against any regular expression you specify. That's really all the email rule is anyway is anyway: a special case of the match rule. For more information see the Struts documentation.
You know that UTF8 email addresses are still no standard? I think some servers are implementing it, but that addresses can only be used inside that server domain; when an email needs to "get out" of it, it needs to be translated into ASCII (by the moment). So is there any real reason you must accept this kind of emails (like an app that can only be used inside the same domain)?
Joined: Mar 06, 2006
Hi All, With the mask property you can validate the characters that can be entered in the field, which is fine ...But when you going to validate through the email validate rule then in that case we have faliure of the email id
Thanks in advance for your prompt answer
Joined: Feb 15, 2005
What I'm telling you is to use the mask rule instead of the email rule, and not use the email rule at all.
Merill is RIGHT ! ... you can write your own regularExpression for email as per your requirements. You can refer to some sample examples for regular expressions on the internet and use them in your mask. You can also refer to http://www.regular-expressions.info/
... hope this helps !
Thanks mkar Patkar
Thanks and Regards
Omkar Patkar (SCJP 1.4)[url]http://javacollectionsnotes.blogspot.com[/url] | [url]http://omkar-myscjpexp.blogspot.com[/url]