Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
validate mail in jsp (Java server pages ) , the following code contain two snippet ,the first one is using custom tags ,the second is a java bean class.
public class mailchecker implements java.io.Serializable{
String email; String password; boolean valid;
public mailchecker() {
this.valid=false; }
public boolean isValid(){
/* This method is called in the jsp file , here you put your code to check on mail , and set the value of valid property . */ this.valid=true; return valid;
} // set the email value public void setEmail(String _email){
if(_email != null && _email.length() > 0) email = _email; else email = "Unknown"; } // Return the current email public String getEmail(){
return email; } // Set the value of the password public void setPassword(String _password){
if(_password != null && _password.length() > 0) password = _password; else password = "none"; } // Return the value of password property public String getPassword(){
return password; }
}
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )