strust2+spring2.5+hibernate框架例题

  • Y7_735822
    了解作者
  • 19.4MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-20 05:32
    上传日期
strust2+spring2.5+hibernate框架例题, 手动配的框架,lib下有详细的包.
struts0.2.rar
内容介绍
package action; import com.opensymphony.xwork2.ActionSupport; import dao.imp.UserInfoImpl; import entity.User; public class LoginAction extends ActionSupport { private UserInfoImpl userInfo ; private int id; private String username; private String password; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public UserInfoImpl getUserInfo() { return userInfo; } public void setUserInfo(UserInfoImpl userInfo) { this.userInfo = userInfo; } @Override public void validate() { if ("".equals(username) || "".equals(password)) { this.addFieldError("username", "请输入有效参数"); } } @Override public String execute() throws Exception { User user = new User(); user.setUsername(username); user.setPassword(password); if (null == userInfo.check(user)) { return this.ERROR; } return super.SUCCESS; } }
评论
    相关推荐