您的位置:首页 > 编程语言 > Java开发

4.Struts的<action input=""></action>:业务逻辑层

2012-08-25 08:42 645 查看
package com.bjpowernode.struts;

public class UserManager {

public void login(String username, String password) {
if (!"admin".equals(username)) {
throw new UserNotFoundException();
}

if (!"admin".equals(password)) {
throw new PasswordErrorException();
}

}
}


package com.bjpowernode.struts;

public class UserNotFoundException extends RuntimeException {

public UserNotFoundException() {
// TODO Auto-generated constructor stub
}

public UserNotFoundException(String message) {
super(message);
// TODO Auto-generated constructor stub
}

public UserNotFoundException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}

public UserNotFoundException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}

}


package com.bjpowernode.struts;

public class PasswordErrorException extends RuntimeException {

public PasswordErrorException() {
// TODO Auto-generated constructor stub
}

public PasswordErrorException(String message) {
super(message);
// TODO Auto-generated constructor stub
}

public PasswordErrorException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}

public PasswordErrorException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐