you could use a small java code and do the validation via regexp

here is a DEMO:

import java.lang.*;
import java.util.*;
import org.apache.oro.text.regex.*;

public final class isEmail
{
 public static boolean check(String email)
 {
  PatternMatcher matcher;
  PatternCompiler compiler;
  Pattern p1 = null;
  PatternMatcherInput input;
  MatchResult result;

  compiler = new Perl5Compiler();
  matcher = new Perl5Matcher();

  String r1="^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*$";

  try
  {

   p1 =
compiler.compile(r1,Perl5Compiler.MULTILINE_MASK+Perl5Compiler.CASE_INSENSIT
IVE_MASK);
  } catch (MalformedPatternException e)
  {
   return true;
  }

  input = new PatternMatcherInput(email);

  return matcher.contains(input,p1);
 }
}

see: http://jakarta.apache.org/oro/index.html
for more details regarding regexp !


Catalin

----- Original Message -----
From: Jack Li
To: '[EMAIL PROTECTED]'
Sent: Wednesday, October 09, 2002 3:53 PM
Subject: How to validate email address in JSP by using javax.mail?


Hi, How to validate email address in JSP by using javax.mail?



Thanks,

Jack Li


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

Reply via email to