beginJsp2.0外文书籍源代码

源代码在线查看: user2.java

软件大小: 228 K
上传用户: GUAIGUAICHENGTI
关键词: beginJsp 2.0 书籍 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				package com.wrox.except;
				
				import java.io.IOException;
				
				public class User2
				{
				
				  private String username;
				  private String password;
				
				  public User2()
				  {
				  }
				
				  public void setUsername(String username)
				  {
				    this.username = username;
				  }
				
				  public String getUsername()
				  {
				    return this.username;
				  }
				
				  public void setPassword(String password)
				  {
				    this.password = password;
				  }
				
				  public void validate() throws IOException, Exception
				  {
				    if(this.username == null || this.password == null)
				    {
				      IOException ioex = new IOException("You must supply a username"
				                                       + " and password!!");
				      throw ioex;
				    }
				    if (!(this.username.equals("Casey")
				       && this.password.equals("Kochmer")))
				    {
				      Exception trouble = new Exception("Couldn't validate your"
				                                      + " password!");
				      throw trouble;
				    }
				  }
				}
							

相关资源