package org.andy.shop.action;
import java.util.List;
import org.andy.shop.entity.UserInfo;
import org.andy.shop.service.UserInfoService;
import org.andy.shop.utils.AjaxUtil;
import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;
/**
* 创建时间:2015-2-13 下午2:49:22
*
* @author andy
* @version 2.2 描述: user的Action
*/
@Namespace("/user")
public class UserinfoAction extends ActionSupport implements
ModelDriven<UserInfo>, Preparable {
private static final long serialVersionUID = -2301203156032690317L;
private static final Logger LOGGER = Logger.getLogger(UserinfoAction.class);
private Integer id;
private UserInfo userInfo;
private List<UserInfo> userInfos;
@Autowired
private UserInfoService userInfoService;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public UserInfo getUserInfo() {
return userInfo;
}
public void setUserInfo(UserInfo userInfo) {
this.userInfo = userInfo;
}
public List<UserInfo> getUserInfos() {
return userInfos;
}
public void setUserInfos(List<UserInfo> userInfos) {
this.userInfos = userInfos;
}
@Override
public UserInfo getModel() {
if (null != id) {
userInfo = userInfoService.get(id);
} else {
userInfo = new UserInfo();
}
return userInfo;
}
@Override
public String execute() throws Exception {
LOGGER.info("查询所有用户");
userInfos = userInfoService.findAll();
return SUCCESS;
}
public void detail() {
String id = ServletActionContext.getRequest().getParameter("id");
LOGGER.info("查看用户详情:" + id);
userInfo = userInfoService.get(Integer.valueOf(id));
AjaxUtil.ajaxJSONResponse(userInfo);
}
@Override
public void prepare() throws Exception {
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Maven搭建spring_struts2_Hibernate_demo (113个子文件)
UserinfoAction.class 3KB
UserinfoAction.class 3KB
UserInfoDaoImpl.class 3KB
UserInfoDaoImpl.class 3KB
UserInfoServiceImpl.class 2KB
UserInfoServiceImpl.class 2KB
UserInfo.class 2KB
UserInfo.class 2KB
TestUserService.class 2KB
AjaxUtil.class 1KB
AjaxUtil.class 1KB
GenericDao.class 638B
GenericDao.class 638B
UserInfoService.class 542B
UserInfoService.class 542B
UserInfoDao.class 280B
UserInfoDao.class 280B
.classpath 1KB
org.eclipse.wst.common.component 1KB
org.eclipse.wst.jsdt.ui.superType.container 49B
hibernate-core-4.3.8.Final.jar 5.03MB
druid-1.0.12.jar 1.83MB
aspectjweaver-1.8.4.jar 1.78MB
jackson-databind-2.5.0.jar 1.08MB
spring-context-4.1.4.RELEASE.jar 1002KB
spring-core-4.1.4.RELEASE.jar 983KB
ehcache-core-2.4.3.jar 983KB
mysql-connector-java-5.1.34.jar 938KB
freemarker-2.3.19.jar 909KB
struts2-core-2.3.20.jar 807KB
spring-web-4.1.4.RELEASE.jar 698KB
javassist-3.18.1-GA.jar 697KB
spring-beans-4.1.4.RELEASE.jar 692KB
xwork-core-2.3.20.jar 656KB
log4j-1.2.17.jar 478KB
antlr-2.7.7.jar 435KB
spring-jdbc-4.1.4.RELEASE.jar 417KB
jstl-1.2.jar 405KB
fastjson-1.2.3.jar 400KB
commons-lang3-3.2.jar 376KB
spring-orm-4.1.4.RELEASE.jar 367KB
spring-aop-4.1.4.RELEASE.jar 351KB
dom4j-1.6.1.jar 307KB
spring-expression-4.1.4.RELEASE.jar 253KB
spring-tx-4.1.4.RELEASE.jar 247KB
jackson-core-2.5.0.jar 224KB
ognl-3.0.6.jar 223KB
commons-io-2.2.jar 170KB
hibernate-ehcache-4.3.8.Final.jar 132KB
hibernate-jpa-2.1-api-1.0.0.Final.jar 111KB
xml-apis-1.0.b2.jar 107KB
jandex-1.1.0.Final.jar 75KB
hibernate-commons-annotations-4.0.5.Final.jar 74KB
commons-fileupload-1.3.1.jar 67KB
struts2-convention-plugin-2.3.20.jar 66KB
commons-logging-1.2.jar 60KB
jboss-logging-3.1.3.GA.jar 56KB
asm-5.0.2.jar 52KB
asm-commons-5.0.2.jar 41KB
jackson-annotations-2.5.0.jar 39KB
asm-tree-5.0.2.jar 28KB
jboss-transaction-api_1.2_spec-1.0.0.Final.jar 27KB
slf4j-api-1.6.1.jar 25KB
struts2-spring-plugin-2.3.20.jar 21KB
jboss-logging-annotations-1.2.0.Beta1.jar 11KB
aopalliance-1.0.jar 4KB
UserinfoAction.java 2KB
UserInfoDaoImpl.java 2KB
UserInfo.java 1KB
UserInfoServiceImpl.java 1KB
AjaxUtil.java 1KB
TestUserService.java 1KB
UserInfoService.java 498B
GenericDao.java 454B
UserInfoDao.java 267B
.jsdtscope 508B
userinfo.jsp 1016B
userinfo.jsp 1016B
index.jsp 52B
index.jsp 52B
MANIFEST.MF 39B
MANIFEST.MF 39B
.mymetadata 368B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.jdt.core.prefs 5KB
org.maven.ide.eclipse.prefs 218B
org.eclipse.core.resources.prefs 196B
org.eclipse.m2e.core.prefs 122B
org.hibernate.eclipse.console.prefs 109B
com.genuitec.eclipse.j2eedt.core.prefs 87B
.project 2KB
log4j.properties 1KB
log4j.properties 1KB
log4j.properties 1KB
config.properties 376B
config.properties 376B
config.properties 376B
pom.properties 140B
New Project 20150301 1458.sql 2KB
spring_struts2_Hibernate_demo.war 23.43MB
共 113 条
- 1
- 2
Andyzty
- 粉丝: 808
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 80632180.jpg
- 李旭国体注入追踪[5.0](1).zip
- semantic.c
- C语言基础-C语言编程基础之Leetcode编程题解之第39题组合总和.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第38题外观数列.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第37题解数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第36题有效的数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第35题搜索插入位置.zip
- index.wxml
- C语言基础-C语言编程基础之Leetcode编程题解之第33题搜索旋转排序数组.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页