资源简介

用struts做的一个简单的例子,主要利用了struts的框架,使用mysql数据库

资源截图

代码片段和文件信息

package org.duqiuye.struts.action;

import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Date;

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.duqiuye.struts.dbc.MyConnenction;

public class AddAskLeaveInfo extends Action {

public ActionForward execute(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response)
throws Exception {

String nowtime = ““; 
Date date = new Date();
SimpleDateFormat DF = new SimpleDateFormat(“yyyy-MM-dd“); 
nowtime = DF.format(date);

String name = request.getParameter(“name“);
String starttime = request.getParameter(“starttime“);
String days = request.getParameter(“days“);
String reason = request.getParameter(“reason“);
String ratifier = request.getParameter(“ratifier“);
String edittime = nowtime;
String mark = request.getParameter(“mark“);

String sql = “insert into askleave(namestarttimedaysreasonratifieredittimemark) “ +
“values(‘“+name+“‘‘“+starttime+“‘“+days+“‘“+reason+“‘‘“+ratifier+“‘‘“+edittime+“‘‘“+mark+“‘)“;
System.out.println(sql);

MyConnenction conn = new MyConnenction();
Statement stmt = conn.getconnection().createStatement();
stmt.executeUpdate(sql);

return mapping.findForward(“addsuc“);
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        563  2010-06-04 19:56  PAS\PAS\.classpath

     文件        282  2010-06-04 19:56  PAS\PAS\.mymetadata

     文件        258  2010-06-04 19:56  PAS\PAS\.mystrutsdata

     文件       1304  2010-06-04 19:56  PAS\PAS\.project

     文件        334  2010-06-04 19:56  PAS\PAS\.settings\org.eclipse.jdt.core.prefs

     文件       1564  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\AddAskLeaveInfo.java

     文件       1272  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\AddEmployeeInfo.java

     文件       2217  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\AddPayInfo.java

     文件       1200  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\AskLeaveInfoAction.java

     文件       1092  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\DeleteAskLeaveInfo.java

     文件       1099  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\DeleteEmployeeInfo.java

     文件       1082  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\DeletePayInfo.java

     文件       1197  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\EmployeeInfoAction.java

     文件        880  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\LoginManageAction.java

     文件        569  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\Main.java

     文件       1149  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\action\PayInfoAction.java

     文件         82  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\ApplicationResources.properties

     文件        134  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\dao\AdministratorDAO.java

     文件        172  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\dao\AskLeaveDAO.java

     文件        173  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\dao\EmployeeDAO.java

     文件        167  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\dao\PayDAO.java

     文件       1068  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\daoimpl\AdministratorImpl.java

     文件       2216  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\daoimpl\AskLeaveImpl.java

     文件       2114  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\daoimpl\EmployeeImpl.java

     文件       2532  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\daoimpl\PayImpl.java

     文件        788  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\dbc\MyConnenction.java

     文件        672  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\filter\CharSetFilter.java

     文件        399  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\po\AdministratorPo.java

     文件       1221  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\po\AskLeavePo.java

     文件        997  2010-06-04 19:56  PAS\PAS\src\org\duqiuye\struts\po\EmployeePo.java

............此处省略89个文件信息

评论

共有 条评论