This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes  Email validation using validation.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark " Email validation using validation.xml" Watch " Email validation using validation.xml" New topic

Email validation using validation.xml

Archana Singh

Joined: Oct 11, 2003
Posts: 2
Hi, I have an email field to validate in my form and I need to do it using validation.xml.I am using struts 1.1. Here is the code snippet from validation.xml -
<field property="" depends="required,email">
<arg0 key=""/>
The key is defined in file.The problem is - When I enter NOTHING in the email field, it says that it is required(which means required is working). But if I enter junk characters, it is taking them and does not validate them! Can anyone tell me wut do I need to do to fix this..
Eric Sexton
Ranch Hand

Joined: Sep 12, 2003
Posts: 133
When you say "its taking them", are you saying that your form is getting submitted?
Is your email validateEmail method getting called? I would put a System.out in there to check to see if it is actually getting called.
Have you checked out Aspose?
subject: Email validation using validation.xml
It's not a secret anymore!