Begining JSP Web Development外文书籍源代码

源代码在线查看: user2.java

软件大小: 1831 K
上传用户: junjie_x
关键词: Development Begining JSP Web
下载地址: 免注册下载 普通下载 VIP

相关代码

				package com.wrox.errors;
				
				import java.beans.*;
				import javax.servlet.jsp.PageContext;
				import javax.servlet.http.HttpSession;
				import java.lang.Exception;
				
				public class User2 extends Object implements java.io.Serializable {
				
				  public User2() {}
				
				  private String username;
				  private String password;
				
				  public void setUsername(String name) {
				    username = name;
				  }
				
				  public String getUsername() {
				    return username;
				  }
				
				  public void setPassword(String pass) {
				    password = pass;
				  }
				
				  public void validateUser() throws Exception, NullPointerException {
				    if ((username == null) || (password == null)) {
				      NullPointerException trouble = new NullPointerException
				                                   ("Must supply a username and password!");
				      throw trouble;
				    }
				
				    if (!(username.equals("Casey") && password.equals("Kochmer"))) {
				      Exception trouble = new Exception("Couldn't validate your password!");
				      throw trouble;
				    }
				  }
				}
							

相关资源