Richard,

JavaScript validations are majorly done on client side and so it would be possible to do a actual validation of the email addresses. The JavaScript email validations mostly will check whether the email is in a valid format. (i.e. even [EMAIL PROTECTED] would pass a validation)

If you have to do a whois validation the best would be to use the struts validator framework. This gives you a two-pronged validation - both client side as well as server side. The clientside Javascript validation ill check if the email is of valid format. You could probably override the server side validation to actually plug-in the code to validate with whois.

The other option would be to have a hidden frame, while validating the email address, use the hidden frame to redirect to a JSP or servlet which validates the email with whois and prompt the user accordingly.

HTH

Regards,
Nitesh


----- Original Message ----- From: "Richard Reyes" <[EMAIL PROTECTED]>
To: "Martin Gainty" <[EMAIL PROTECTED]>
Cc: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, June 16, 2005 9:21 AM
Subject: Re: [OT] Validating email addresses


Unfortunately guys all will be done on javascript. Any suggestion on
proven downloadble javascript components would be very much
appreciated. I might just code for the domain name validations.

Can I get the valid list from whois.org?

Thanks All
Richard

On 6/15/05, Martin Gainty <[EMAIL PROTECTED]> wrote:
Richard-
Can you run basic DNS nslookup utilities and or have access to
BIND a.root-servers.net - m.root-servers.net?
-OR-

You may want to use a combination of parsing the URL such as
http://java.sun.com/docs/books/tutorial/networking/urls/urlInfo.html

import java.net.*;
import java.io.*;

public class ParseURL {
   public static void main(String[] args) throws Exception {
       URL aURL = new URL("http://java.sun.com:80/docs/books/";
                          + "tutorial/index.html#DOWNLOADING");
       System.out.println("protocol = " + aURL.getProtocol());
       System.out.println("host = " + aURL.getHost());
       System.out.println("filename = " + aURL.getFile());
       System.out.println("port = " + aURL.getPort());
       System.out.println("ref = " + aURL.getRef());
   }
}

and then attempting to access the URL
http://java.sun.com/docs/books/tutorial/networking/urls/connecting.html
try {
   URL yahoo = new URL("http://www.yahoo.com/";);
   URLConnection yahooConnection = yahoo.openConnection();

} catch (MalformedURLException e) {     // new URL() failed
   . . .
} catch (IOException e) {               // openConnection() failed
   . . .
}

Martin-
----- Original Message -----
From: "Richard Reyes" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, June 15, 2005 6:02 AM
Subject: [OT] Validating email addresses


Hi Guys,

I plan to validate email addresses and Domain names entered by users
via those downloadable
javascripts. Any suggestions?

Also if I am to validate these fields do I need to know the valid .com
or .net domains?

Please advise
TIA!

Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to