beginJsp2.0外文书籍源代码
源代码在线查看: userlist.java
package com.wrox.secure;
import java.util.*;
class UserList
{
private Vector list = new Vector();
public UserList()
{
list.add(new User("Erick","tomcat"));
list.add(new User("SevenOfNine","regayov"));
list.add(new User("Kirk","esirpretne"));
}
public boolean isValidUser(User user)
{
for(int iCount = 0; iCount < list.size(); iCount++)
{
User temp = (User)list.get(iCount);
if(user.getUserName() == temp.getUserName()
&& user.getPassword() == temp.getPassword())
return true;
else
return false;
}
return true;
}
}