打印本文 打印本文 关闭窗口 关闭窗口
Struts开发指南之工作流程
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1717  更新时间:2009/4/22 23:28:03  文章录入:mintao  责任编辑:mintao
tabase Database in which to look up the user
* @param username Username specified on the logon form
*
* @exception ModuleException if a business logic rule is violated
*/
public User getUser(UserDatabase database, String username)
throws ModuleException {

// Force an ArithmeticException which can be handled explicitly
if ("arithmetic".equals(username)) {
 throw new ArithmeticException();
}

// Force an application-specific exception which can be handled
if ("expired".equals(username)) {
 throw new ExpiredPasswordException(username);
}

// Look up and return the specified user
return ((User) database.findUser(username));

}
}

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口