资源简介
在短学期中做的web小项目,基本涵盖web书的各项知识点,如过滤器,自定义标签,dao连数据库,分页等等,仅供大家学习参考。

代码片段和文件信息
package com.Car.Controler;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.Car.Dao.*;
import com.Car.Model.CarBean;
import com.Car.Model.PageModel;
import javax.servlet.annotation.WebServlet;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
@WebServlet(“/addCar.do“)
public class AddCarServlet extends HttpServlet {
public void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
CarDao dao = new CarDao();
CarBean car = new CarBean();
PrintWriter out = response.getWriter();
int id = 0;
int park_space[] = (int[]) request.getSession().getAttribute(“park_space“);
for (int i = 1; i <= 100; ++i) {
if (park_space[i] != 0) {
id = i;
park_space[i] = 0;
break;
}
}
if (id == 0) {
out.print(404);
} else {
try {
car.setId(id);
car.setCar_id(request.getParameter(“car_id“));
car.setType(request.getParameter(“type“));
car.setMaster(request.getParameter(“master“));
car.setMas_id(request.getParameter(“mas_id“));
car.setIn_time(request.getParameter(“in_time“));
car.setOut_time(null);
car.setCur_cost(“0“);
car.setIfExit(1);
boolean success = dao.addCar(car 1);
if (success) {
out.print(id);
} else {
out.print(500);
}
} catch (Exception e) {
System.out.print(“insert error!“);
}
PageModel pm0 = (PageModel) request.getSession().getAttribute(“pm0“);
List cars0 = new ArrayList();
if (!pm0.getDatas().isEmpty())
cars0 = pm0.getDatas();
cars0.add(0 car);
pm0.setDatas(cars0);
pm0.setRecordCount(pm0.getRecordCount() + 1);
PageModel pm = new PageModel();
List cars = new ArrayList();
int pageNo = (int) request.getSession().getAttribute(“pageNo“);
int pageSize = (int) request.getSession().getAttribute(“pageSize“);
for (int i = (pageNo - 1) * pageSize; i < pageNo * pageSize && i < cars0.size(); i++) {
cars.add(cars0.get(i));
}
pm.setDatas(cars);
pm.setRecordCount(pm0.getRecordCount());
request.getSession().setAttribute(“pm“ pm);
request.getSession().setAttribute(“park_space“ park_space);
// RequestDispatcher rd =
// getServletContext().getRequestDispatcher(“/addCar.jsp“);
// rd.forward(request response);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-11-19 17:25 简易停车场收费管理系统\
文件 1229798 2016-07-17 23:38 简易停车场收费管理系统\停车管理系统使用说明书.docx
文件 19900 2016-07-14 04:46 简易停车场收费管理系统\停车管理系统实验报告.docx
文件 1403911 2016-07-17 23:53 简易停车场收费管理系统\停车管理系统技术报告.docx
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统数据库文件\
文件 8834 2016-07-12 20:33 简易停车场收费管理系统\停车管理系统数据库文件\car.frm
文件 8834 2016-07-12 20:54 简易停车场收费管理系统\停车管理系统数据库文件\carleave.frm
文件 8606 2016-07-03 16:35 简易停车场收费管理系统\停车管理系统数据库文件\user.frm
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\
文件 841 2016-07-14 09:13 简易停车场收费管理系统\停车管理系统源代码\.classpath
文件 1048 2016-07-03 10:14 简易停车场收费管理系统\停车管理系统源代码\.project
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\.settings\
文件 567 2016-07-03 10:14 简易停车场收费管理系统\停车管理系统源代码\.settings\.jsdtscope
文件 364 2016-07-03 10:14 简易停车场收费管理系统\停车管理系统源代码\.settings\org.eclipse.jdt.core.prefs
文件 497 2016-07-14 09:13 简易停车场收费管理系统\停车管理系统源代码\.settings\org.eclipse.wst.common.component
文件 345 2016-07-03 10:14 简易停车场收费管理系统\停车管理系统源代码\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-07-03 10:14 简易停车场收费管理系统\停车管理系统源代码\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-07-03 10:14 简易停车场收费管理系统\停车管理系统源代码\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\WebContent\
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\css\
文件 484 2016-07-03 14:43 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\css\bgstretcher.css
文件 109522 2016-07-03 14:43 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\css\bootstrap.min.css
文件 1631 2016-07-03 14:43 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\css\login.css
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\
文件 3348 2016-07-17 23:26 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\addCar.jsp
目录 0 2016-11-19 17:23 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\bin\
文件 30742 2016-07-04 14:32 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\bin\ESC.wsf
文件 131677 2016-07-04 14:32 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\bin\dwz.min.js
文件 91648 2016-07-04 14:32 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\bin\gzip.exe
文件 1565 2016-07-04 14:32 简易停车场收费管理系统\停车管理系统源代码\WebContent\CarSystem\dwz_jui-master\bin\gzjs-esc.bat
............此处省略892个文件信息
- 上一篇:深圳shp 地图数据
- 下一篇:KUKA库卡用户操作及编程指南8.3_2015
相关资源
- 数字华容道
-
大数据。基于Hba
se的网站日志分析系 - Servlet API中文文档
- SSM+Shiro+redis实现单点登陆
- jstl-api-1.2和jstl-impl-1.2
- 基于MVC模式的会员管理系统
- 编写简单的RMI程序 多线程web 服务器
- 基于web的毕业设计开题报告
- 国内一家大型软件公司内部的正规软
- 仿windows记事本
- web班级网站设计代码
- websocket实现一对一聊天
- GUI银行管理系统
- 3DWebGIS 3DWebGIS
- web js虚拟键盘(中英文切换)
- 超市收银系统eclipse access大学课程设计
- WinCE中的Web Service调用
- 模拟ATM柜员机系统--连接数据库
- WEB系统界面设计模板(很漂亮)
- web民族旅游网站源码
- A*算法的2D演示(带源码)
- 代码审查表和代码审查实例
- 基于Web的高校教务管理系统的设计与
- 通过webservice上传和下载文件
- 仿126 网易 163 邮箱 界面
- Tomcat6.x
- 简单的行编辑器
- 扫雷(MVC架构)
- 基于SSM+CXF构建的RESTFul webservice
- 302 Found
评论
共有 条评论