package com.cx.test.Action;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.cx.test.Entity.User;
import com.cx.test.Service.Inter.UserManager;
import com.opensymphony.xwork2.ActionSupport;
@Component("userAction")
public class UserAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String username;
private String password;
private String password2;
UserManager userManager;
public String registerUser() {
User u=new User();
u.setUsername(getUsername());
u.setPassword(getPassword());
if(userManager.userExitsWithName(u)){
this.addFieldError("registerError", "�û����Ѿ�����");
return "error";
}
userManager.addUser(u);
this.addFieldError("registerSuccess", "�û�ע��ɹ�!");
return SUCCESS;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPassword2() {
return password2;
}
public void setPassword2(String password2) {
this.password2 = password2;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public UserManager getUserManager() {
return userManager;
}
@Resource(name="userManager")
public void setUserManager(UserManager userManager) {
this.userManager = userManager;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
TestSSH.rar (56个子文件)
TestSSH
WebContent
META-INF
MANIFEST.MF 39B
WEB-INF
web.xml 923B
lib
freemarker-2.3.15.jar 859KB
commons-collections-3.1.jar 546KB
hibernate-annotations.jar 273KB
dom4j-1.6.1.jar 307KB
spring.jar 2.81MB
mysql-connector-java-5.1.7-bin.jar 693KB
ejb3-persistence.jar 49KB
log4j-1.2.16.jar 470KB
common-annotations.jar 6KB
javassist-3.9.0.GA.jar 583KB
hibernate-commons-annotations.jar 65KB
aspectjweaver.jar 1.47MB
struts2-spring-plugin-2.1.8.1.jar 16KB
commons-logging-1.1.jar 52KB
cglib-nodep-2.1_3.jar 317KB
aspectjrt.jar 112KB
struts2-core-2.1.8.jar 738KB
commons-pool.jar 61KB
xwork-core-2.1.6.jar 1.49MB
commons-fileupload-1.2.1.jar 56KB
slf4j-api-1.5.8.jar 23KB
commons-dbcp.jar 119KB
slf4j-log4j12-1.5.8.jar 9KB
jta-1.1.jar 13KB
antlr-2.7.6.jar 433KB
hibernate3.jar 2.31MB
applicationContext.xml 3KB
result.jsp 1KB
index.jsp 924B
register.jsp 2KB
.settings
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.project.facet.core.xml 345B
org.eclipse.wst.common.component 451B
org.eclipse.wst.jsdt.ui.superType.container 49B
.jsdtscope 503B
org.eclipse.jdt.core.prefs 395B
src
log4j.properties 2KB
com
cx
test
Service
Impl
UserManagerImpl.java 1004B
Inter
UserManager.java 199B
Entity
User.java 721B
Dao
Action
UserAction.java 1KB
Util
HibernateUtil.java 741B
struts.xml 941B
hibernate.cfg.xml 942B
.project 1KB
.classpath 834B
build
classes
log4j.properties 2KB
com
cx
test
Service
Impl
UserManagerImpl.class 2KB
Inter
UserManager.class 206B
Entity
User.class 1KB
Dao
Action
UserAction.class 2KB
Util
HibernateUtil.class 1KB
struts.xml 941B
hibernate.cfg.xml 942B
共 56 条
- 1
资源评论
- qcqcc2012-06-20实例不错,是struts2
zhaowei881107
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功