资源简介
首先是关于[评价可免费]的严正声明
一、评价=评论加评价(评星星)
二、评价必须是下载完了该资源后的评价,没下载评价无效
三、如果正确评价了,返还积分可能需要等一会,因为系统需要反应。
评论时记得要评分。然后会返回给你花费的分再加1分。理论上有10分就可以下载所有资源。
一般人我不告诉他
使用Struts和Hibernate加上MySql数据库和讲解项目的PPT
代码片段和文件信息
package com.sanqing.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.HibernateException;
import com.sanqing.dao.EducateDao;
import com.sanqing.po.Educate;
/**
* @author BWeiMing
*
*/
public class EducateAction extends Action {
private EducateDao dao=new EducateDao();
public ActionForward execute(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) throws Exception {
String action =request.getParameter(“action“);
System.out.println(“\nEducateAction*********************action=“+action);
if(action==null||““.equals(action)){
return mapping.findForward(“error“);
}else if(“listeducate“.equals(action)){
return listEducate(mappingformrequestresponse);
}else if(“addeducate“.equals(action)){
return addEducate(mappingformrequestresponse);
}else if(“deleteeducate“.equals(action)){
return deleteEducate(mappingformrequestresponse);
}else if(“detaileducate“.equals(action)){
return detailEducate(mappingformrequestresponse);
}else if(“updateeducate“.equals(action)){
return updateEducate(mappingformrequestresponse);
}
return mapping.findForward(“error“);
}
/**
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HibernateException
*/
private ActionForward updateEducate(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws HibernateException {
EducateForm educateForm=(EducateForm)form;
Educate e=educateForm.populate();
dao.updateEducate(e);
return mapping.findForward(“success“);
}
/**
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HibernateException
*/
private ActionForward detailEducate(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws HibernateException {
Long id=new Long(request.getParameter(“id“));
Educate e = dao.loadEducate(id.longValue());
System.out.println(e.getName());
request.setAttribute(“educate“e);
return mapping.findForward(“success“);
}
/**
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HibernateException
*/
private ActionForward deleteEducate(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws HibernateException {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 780 2010-01-28 14:44 05 MySQL\JavaPrj_5\.classpath
文件 508 2009-10-21 09:24 05 MySQL\JavaPrj_5\.myhibernatedata
文件 300 2010-01-28 14:44 05 MySQL\JavaPrj_5\.myme
文件 258 2009-10-21 09:48 05 MySQL\JavaPrj_5\.mystrutsdata
文件 1512 2009-10-21 10:02 05 MySQL\JavaPrj_5\.project
文件 4413 2009-10-21 10:49 05 MySQL\JavaPrj_5\src\com\sanqing\action\EducateAction.java
文件 5379 2009-10-21 09:57 05 MySQL\JavaPrj_5\src\com\sanqing\action\EducateForm.java
文件 4266 2009-10-21 09:58 05 MySQL\JavaPrj_5\src\com\sanqing\action\InstitutionAction.java
文件 2681 2009-10-21 09:58 05 MySQL\JavaPrj_5\src\com\sanqing\action\InstitutionForm.java
文件 3477 2009-10-26 15:38 05 MySQL\JavaPrj_5\src\com\sanqing\action\JobAction.java
文件 5971 2009-10-21 09:58 05 MySQL\JavaPrj_5\src\com\sanqing\action\JobForm.java
文件 4082 2009-10-23 15:22 05 MySQL\JavaPrj_5\src\com\sanqing\action\StipendAction.java
文件 4759 2009-10-23 15:22 05 MySQL\JavaPrj_5\src\com\sanqing\action\StipendForm.java
文件 3849 2009-10-25 09:53 05 MySQL\JavaPrj_5\src\com\sanqing\action\UsersAction.java
文件 4597 2009-10-21 09:59 05 MySQL\JavaPrj_5\src\com\sanqing\action\UsersForm.java
文件 3239 2009-10-21 10:57 05 MySQL\JavaPrj_5\src\com\sanqing\dao\EducateDao.java
文件 2442 2009-10-21 10:58 05 MySQL\JavaPrj_5\src\com\sanqing\dao\InstitutionDao.java
文件 3222 2009-10-26 15:33 05 MySQL\JavaPrj_5\src\com\sanqing\dao\JobDao.java
文件 3516 2009-10-21 10:58 05 MySQL\JavaPrj_5\src\com\sanqing\dao\StipendDao.java
文件 3293 2009-10-25 09:46 05 MySQL\JavaPrj_5\src\com\sanqing\dao\UsersDao.java
文件 3332 2009-10-21 09:24 05 MySQL\JavaPrj_5\src\com\sanqing\hb\HibernateSessionFactory.java
文件 1021 2009-10-23 11:32 05 MySQL\JavaPrj_5\src\com\sanqing\po\Educate.hbm.xm
文件 4203 2009-10-23 09:12 05 MySQL\JavaPrj_5\src\com\sanqing\po\Educate.java
文件 619 2009-10-26 14:24 05 MySQL\JavaPrj_5\src\com\sanqing\po\Institution.hbm.xm
文件 1945 2009-10-23 14:26 05 MySQL\JavaPrj_5\src\com\sanqing\po\Institution.java
文件 1107 2009-10-23 11:21 05 MySQL\JavaPrj_5\src\com\sanqing\po\Job.hbm.xm
文件 4555 2009-10-22 20:58 05 MySQL\JavaPrj_5\src\com\sanqing\po\Job.java
文件 905 2009-10-23 11:49 05 MySQL\JavaPrj_5\src\com\sanqing\po\Stipend.hbm.xm
文件 3708 2009-10-23 09:30 05 MySQL\JavaPrj_5\src\com\sanqing\po\Stipend.java
文件 784 2009-10-23 11:11 05 MySQL\JavaPrj_5\src\com\sanqing\po\Users.hbm.xm
............此处省略181个文件信息
评论
共有 条评论