Validation of Email
as a developer there are times when making an application, we see things that the user enter a field that must match the format specified.
like the middle of my current make Java web applications ..
I made a shoutbox which is required to be filled Comment Email to post.
For That I should be doing in the validation of the email put it, an email whether it really exists (Valid) or the Users simply compose an inclusion or other email ...
Well, how do I Perform Validation with Java programming language (because of this article as long as I find who was using other programming languages such as PHP and Visual Studio) ..
which framework you are using for web application.
If it is struts it is straightforward, you can use form-bean validation using Struts validator framwork.
Your validation cannot confirm whether an email address exists, it can only confirm that it conforms to a vague format.
And, really, the only thing you can do is ensure it has an '@' in the middle. There are several regexes out there, but I'm not convinced they actually work in all cases...at least everyone I've seen brought up at the old Sun forums seemed to have a problem with outliers. And since you can't confirm the address exists anyway I doubt it's worth going to all that trouble.
@Profes.vijay :sorry, i don't use any Framework.
@Tolls : "regex" do you mean is regex at package java.util.regex
how about reguler Expression, i hear that's answer of my problem. if yes,
you know source about that??
Short for regular expression, yes.
I'm sure you can google email regex.
Essentially you just want to make sure that there's something alpha-numeric before the '@' and after it. Anything else is, IMO, overkill.
And, as I said, there is no way this will tell you if the address exists or not.
as you can found at top:
if you use j2se you can use Regular Expressions that you can find it here:
email validation,java : java