Results 1 to 6 of 6
  1. #1
    GreatWall is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default 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) ..

    THANKS

  2. #2
    profes.vijay is offline Member
    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Default

    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.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default

    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.

  4. #4
    GreatWall is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default

    @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??

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default

    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.

  6. #6
    Join Date
    Sep 2010
    Posts
    12
    Rep Power
    0

    Default

    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

Similar Threads

  1. Live Email Validation In Java
    By shameel in forum Web Frameworks
    Replies: 9
    Last Post: 01-05-2010, 06:42 AM
  2. String Tokenizer - Basic email validation
    By bobbyboyy in forum New To Java
    Replies: 3
    Last Post: 11-01-2009, 05:44 PM
  3. VAlidation
    By chetna1982 in forum New To Java
    Replies: 2
    Last Post: 12-11-2008, 08:08 AM
  4. send email using apache commons email
    By jnamendi in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 10-14-2008, 06:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •