package com.shiv.myapp.user.action;
import java.util.Collection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import com.shiv.myapp.dao.DaoFactory;
import com.shiv.myapp.dao.UserDao;
import com.shiv.myapp.model.User;
import com.shiv.myapp.user.actionform.UserForm;
public class UserAction extends DispatchAction {
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String target = new String("success");
if (isCancelled(request)) {
return mapping.findForward("success");
}
User user = new User();
UserForm userForm = (UserForm) form;
user.setUsername(userForm.getUsername());
user.setPassword(userForm.getPassword());
try {
// EmployeeData.addEmployee(employee, getDataSource(request));
UserDao userDao = (UserDao) DaoFactory
.getDao("UserDao");
userDao.save(user);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return mapping.findForward(target);
}
public User find(String username)
throws Exception {
User user = null;
try {
// EmployeeData.addEmployee(employee, getDataSource(request));
UserDao userDao = (UserDao) DaoFactory
.getDao("UserDao");
user = userDao.find(username);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return user;
}
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String target = new String("success");
Collection<User> user = null;
/*Utils.setDataSource(getDataSource(request));
//employees = EmployeeData.getEmployees(getDataSource(request));
EmployeeService es = new EmployeeServiceImpl();
employees = (ArrayList)es.list();*/
try {
//EmployeeData.addEmployee(employee, getDataSource(request));
UserDao userDao = (UserDao) DaoFactory.getDao("UserDao");
user = userDao.list();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
request.setAttribute("users", user);
return (mapping.findForward(target));
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
struts_Hibernate_Tomcat.rar_ant_db_base.java
共126个文件
java:44个
class:25个
entries:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 46 浏览量
2022-09-19
16:06:42
上传
评论
收藏 4.84MB RAR 举报
温馨提示
Base Application for the struts Hibernate based application using ant deployer to deploy the application on the tomcat server & to deploy the DB scripts on the MySQL DB.
资源推荐
资源详情
资源评论
收起资源包目录
struts_Hibernate_Tomcat.rar_ant_db_base.java (126个子文件)
UserDaoImpl.class 4KB
DaoHibernateImpl.class 3KB
AddUserAction.class 2KB
ModelUiAction.class 2KB
UserAction.class 2KB
UserForm.class 2KB
DefaultModelHandler.class 2KB
ServiceImpl.class 1KB
DaoFactory.class 1KB
Utils.class 1KB
AuthenticationFilter.class 1KB
UserDaoHibernateImpl.class 1KB
ReportAction.class 1KB
ChartAction.class 1KB
BaseRequestProcessor.class 930B
ModelHandler.class 755B
User.class 735B
ModelHandlerFactory.class 723B
UserServiceImpl.class 541B
Service.class 494B
UserModelHandler.class 484B
Dao.class 482B
UserDao.class 303B
UserService.class 266B
BaseObject.class 122B
.classpath 834B
styles.css 753B
Thumbs.db 4KB
entries 2KB
entries 2KB
entries 643B
entries 643B
entries 515B
entries 515B
entries 388B
entries 388B
entries 290B
entries 290B
entries 288B
entries 288B
entries 277B
entries 277B
page_header.gif 26KB
hibernate3.jar 3.69MB
ant.jar 1010KB
struts.jar 499KB
servlet-api.jar 91KB
UserAction.java 3KB
UserDaoImpl.java 2KB
ModelUiAction.java 2KB
ModelUiAction.java 2KB
DaoHibernateImpl.java 2KB
DaoHibernateImpl.java 2KB
User.java 1KB
AddUserAction.java 1KB
DefaultModelHandler.java 1KB
DefaultModelHandler.java 1KB
UserForm.java 1KB
Utils.java 1KB
ModelHandler.java 994B
ModelHandler.java 994B
ServiceImpl.java 739B
AuthenticationFilter.java 709B
AuthenticationFilter.java 709B
DaoFactory.java 699B
ServiceImpl.java 697B
UserDaoHibernateImpl.java 544B
ReportAction.java 515B
ReportAction.java 515B
ChartAction.java 513B
ChartAction.java 513B
BaseRequestProcessor.java 455B
BaseRequestProcessor.java 455B
User.java 389B
Dao.java 335B
Service.java 333B
Service.java 332B
Dao.java 330B
UserDaoHibernateImpl.java 276B
ModelHandlerFactory.java 265B
ModelHandlerFactory.java 265B
UserServiceImpl.java 206B
UserServiceImpl.java 203B
UserDao.java 152B
UserService.java 132B
UserService.java 129B
UserModelHandler.java 105B
UserModelHandler.java 105B
UserDao.java 87B
BaseObject.java 69B
BaseObject.java 64B
all.js 2KB
siteLayout.jsp 1KB
header.jsp 1KB
taglibs.jsp 1KB
404.jsp 1KB
index.jsp 993B
userForm.jsp 866B
userList.jsp 739B
error.jsp 326B
共 126 条
- 1
- 2
资源评论
林当时
- 粉丝: 113
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功