package com.test.action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.test.service.UserService;
public class LoginAction extends ActionSupport {
public String username;
public String password;
private UserService userService;
public LoginAction()
{
System.out.println("initialize LoginAction......");
}
public void setUserService(UserService userService)
{
this.userService = userService;
}
public String execute()
{
if (true == this.userService.isLogin(username, password))
{
ActionContext.getContext().getSession().put("username", username);
return SUCCESS;
}else{
super.addActionError(super.getText("loginfailed"));
return ERROR;
}
}
public void validate()
{
if ((null == username) || (0==username.length()))
{
super.addActionError(super.getText("warning.empty",new String[] {getText("username")}));
}
if ((null == password) || (0 == password.length()))
{
super.addActionError(super.getText("warning.empty",new String[] {getText("password")}));
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
SSH2 Demo 2.0 (Struts2.2.3 + Hibernate 3.6.8 + Spring3)
共33个文件
xml:10个
properties:6个
java:6个
5星 · 超过95%的资源 需积分: 13 239 下载量 3 浏览量
2011-12-01
11:24:22
上传
评论 4
收藏 18KB ZIP 举报
温馨提示
一个简单的SSH2 登录框架 1. 采用最新的SSH2 jar包和框架 2. 严格按照标准分层设计 3. 实现国际语言转化 4. 配置文件采用最新的标准
资源推荐
资源详情
资源评论
收起资源包目录
MySSH2.0_nojar.zip (33个子文件)
MySSH2
src
com
test
dao
UserDao.java 167B
daoImpl
UserDaoImpl.java 1KB
action
LoginAction.java 1KB
bean
User.hbm.xml 711B
User.java 469B
service
UserService.java 189B
serviceImpl
UserServiceImpl.java 784B
dataSource.properties 168B
applicationContext.xml 1KB
message_zh_CN.properties 371B
struts.xml 681B
message_en_US.properties 273B
database.xml 2KB
build
classes
com
test
dao
UserDao.class 237B
daoImpl
UserDaoImpl.class 2KB
action
LoginAction.class 2KB
bean
User.class 956B
User.hbm.xml 711B
service
UserService.class 214B
serviceImpl
UserServiceImpl.class 2KB
dataSource.properties 168B
applicationContext.xml 1KB
message_zh_CN.properties 371B
struts.xml 681B
message_en_US.properties 273B
database.xml 2KB
.settings
org.eclipse.wst.common.project.facet.core.xml 345B
org.eclipse.jdt.core.prefs 395B
WebContent
login
login.jsp 1KB
loginresult.jsp 998B
login.jsp 1KB
loginresult.jsp 998B
WEB-INF
web.xml 1KB
共 33 条
- 1
bruesz
- 粉丝: 67
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页