/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.xaccp.struts.action;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
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.xaccp.blz.HouseBLZ;
import com.xaccp.entity.TblFwxx;
import com.xaccp.entity.TblUser;
import com.xaccp.struts.form.HouseForm;
public class HouseAction extends DispatchAction {
HouseBLZ blz=new HouseBLZ();
public ActionForward doList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
request.setAttribute("list", blz.findByPage(0, 10));
HttpSession session=request.getSession();
session.setAttribute("qx", blz.findAllTown());
return mapping.findForward("list");
}
public ActionForward dofindById(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String fwid=request.getParameter("fwid");
TblFwxx tf=(TblFwxx)blz.getInfoById(fwid);
request.setAttribute("hib", tf);
return mapping.findForward("detail");
}
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String jibie=request.getParameter("jibie");
HouseForm hf=(HouseForm)form;
if ("1".equals(jibie)) {
String search=hf.getFw().getTitle();
request.setAttribute("list", blz.simSearch(search));
}else{
request.setAttribute("list", blz.advSearch(hf));
}
return mapping.findForward("tolist");
}
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session=request.getSession();
session.invalidate();
return mapping.findForward("list");
}
public ActionForward my(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session=request.getSession();
Integer uid=((TblUser)session.getAttribute("user")).getUid();
request.setAttribute("myList", blz.findByUname(uid));
return mapping.findForward("my");
}
public ActionForward preAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
return mapping.findForward("post");
}
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
TblFwxx tf=(TblFwxx)request.getSession().getAttribute("tf");
blz.insert(tf);
try {
response.sendRedirect("house.do?param=my");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String fwid=request.getParameter("fwid");
blz.delete(fwid);
try {
response.sendRedirect("house.do?param=my");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public ActionForward confirm(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HouseForm hf=(HouseForm)form;
TblFwxx tf=hf.getFw();
tf.setTblFwlx(blz.findTypeById(hf.getLxid()));
tf.setTblJd(blz.findStreetById(hf.getJdid()));
tf.getTblJd().setTblQx(blz.findTownById(hf.getQxid()));
tf.setTblUser((TblUser)request.getSession().getAttribute("user"));
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
try {
if (hf.getDate()==null || hf.getDate().equals("")) {
tf.setDate(new Date());
}else{
Date date=sdf.parse(hf.getDate());
tf.setDate(date);
}
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
request.getSession().setAttribute("tf", tf);
return mapping.findForward("confirm");
}
public ActionForward preUpd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String fwid=request.getParameter("fwid");
TblFwxx tf=blz.getInfoById(fwid);
HouseForm hf=(HouseForm)form;
hf.setFw(tf);
hf.setQxid(tf.getTblJd().getTblQx().getQxid().toString());
hf.setJdid(tf.getTblJd().getJdid().toString());
hf.setLxid(tf.getTblFwlx().getLxid().toString());
hf.setDate(tf.getDate().toString());
//System.out.println(tf.getDate().toString());
return mapping.findForward("post");
}
public ActionForward upd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
TblFwxx tf=(TblFwxx)request.getSession().getAttribute("tf");
blz.updateInfo(tf);
try {
response.sendRedirect("house.do?param=my");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
房屋出租系统-ssh!!!
共143个文件
jar:29个
tld:21个
class:19个
4星 · 超过85%的资源 需积分: 9 52 下载量 51 浏览量
2009-02-16
15:46:10
上传
评论 1
收藏 5.35MB RAR 举报
温馨提示
Struts/Spring/Hibernate 的经典制作!!!!!!!!!!!!!!!哈哈哈哈哈哈哈!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
资源推荐
资源详情
资源评论
收起资源包目录
房屋出租系统-ssh!!! (143个子文件)
HouseAction.class 6KB
HouseInfoDAO.class 5KB
TblFwxx.class 4KB
HouseBLZ.class 3KB
UserAction.class 3KB
BaseHibernateDAO.class 3KB
DbManager.class 2KB
HibernateSessionFactory.class 2KB
HouseForm.class 2KB
UserDAO.class 2KB
TblJd.class 2KB
TblUser.class 2KB
StreetDAO.class 2KB
TblFwlx.class 1KB
TblQx.class 1KB
TownDAO.class 1KB
HouseTypeDAO.class 1KB
UserForm.class 1KB
MyProsessor.class 895B
.classpath 2KB
btn.css 3KB
mycss.css 1KB
text.css 297B
layout_24.gif 945B
hibernate3.jar 1.39MB
xerces-2.6.2.jar 966KB
struts.jar 428KB
antlr-2.7.5H3.jar 417KB
standard.jar 343KB
log4j-1.2.9.jar 303KB
dom4j-1.6.jar 256KB
sqljdbc.jar 247KB
cglib-2.1.jar 243KB
jaxen-1.1-beta-4.jar 202KB
commons-collections-2.1.1.jar 169KB
commons-collections.jar 160KB
xml-apis.jar 117KB
commons-beanutils.jar 100KB
jaas.jar 99KB
commons-digester.jar 96KB
jakarta-oro.jar 62KB
commons-lang.jar 53KB
ehcache-1.1.jar 41KB
commons-validator.jar 40KB
commons-logging-1.0.4.jar 33KB
commons-logging.jar 27KB
asm.jar 25KB
commons-fileupload.jar 19KB
jstl.jar 17KB
asm-attrs.jar 16KB
struts-legacy.jar 9KB
jta.jar 8KB
jdbc2_0-stdext.jar 6KB
HouseAction.java 5KB
HouseInfoDAO.java 3KB
HibernateSessionFactory.java 3KB
TblFwxx.java 3KB
UserAction.java 2KB
BaseHibernateDAO.java 2KB
HouseBLZ.java 2KB
HouseForm.java 2KB
DbManager.java 2KB
TblUser.java 1KB
TblJd.java 1KB
UserForm.java 1KB
TblFwlx.java 1018B
UserDAO.java 1000B
TblQx.java 952B
StreetDAO.java 748B
MyProsessor.java 667B
TownDAO.java 549B
HouseTypeDAO.java 507B
top.jpg 111KB
middle1.jpg 36KB
bottom.jpg 14KB
middle4.jpg 9KB
middle2.jpg 9KB
error0.jpg 3KB
error.jpg 2KB
post.jsp 12KB
index.jsp 6KB
confirm.jsp 3KB
res.jsp 3KB
userInfo.jsp 3KB
detail.jsp 3KB
login.jsp 3KB
my.jsp 3KB
list.jsp 2KB
.struts-config.mex 4KB
MANIFEST.MF 39B
.myhibernatedata 509B
.mymetadata 289B
.mystrutsdata 256B
.myumldata 66B
org.eclipse.wst.validation.prefs 1KB
com.genuitec.eclipse.j2eedt.core.prefs 1KB
org.eclipse.core.resources.prefs 208B
com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs 120B
.project 1KB
ApplicationResources_zh_CN.properties 404B
共 143 条
- 1
- 2
资源评论
- zhoujiaboqaz2014-06-29还不错 对于我们这种新手挺实用的
- 川哥2011-12-21没用到spring管理,只用了基础的struct,太简单,布局也不太好。
wanhahahahaha
- 粉丝: 6
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功