JSP停车场管理系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目包含管理员与用户两种角色;

管理员角色包含以下功能:

管理员登录,管理员信息管理,用户信息管理,车位管理,车费标准管理,停车缴费管理,查询车位状态,停车记录查询等功能。

用户角色包含以下功能:

用户登录,修改个人信息,车辆信息管理,查看卡余额,查看收费标准,车位信息管理,停车记录查看等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 

5.数据库:MySql 5.7版本;

6.是否Maven项目:否;

技术栈

JSP+CSS+JavaScript+jQuery+servlet+mysql

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中DBManager.java配置文件中的数据库配置改为自己的配置;

4. 运行项目,输入localhost:8080/xxx 登录

运行截图

管理员角色

 

 

 

 

 

 

用户角色

 

 

 

 

 相关代码

登陆端管理控制器

public class LoginAction extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public LoginAction() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 * 
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request
	 *            the request send by the client to the server
	 * @param response
	 *            the response send by the server to the client
	 * @throws ServletException
	 *             if an error occurred
	 * @throws IOException
	 *             if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html;charset=UTF-8");
		PrintWriter out = response.getWriter();
		this.doPost(request, response);
		out.close();
	}

	/**
	 * The doPost method of the servlet. <br>
	 * 
	 * This method is called when a form has its tag value method equals to
	 * post.
	 * 
	 * @param request
	 *            the request send by the client to the server
	 * @param response
	 *            the response send by the server to the client
	 * @throws ServletException
	 *             if an error occurred
	 * @throws IOException
	 *             if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html;charset=UTF-8");
		PrintWriter out = response.getWriter();
		String username = request.getParameter("username");
		String userpwd = request.getParameter("userpwd");
		String type = request.getParameter("type");

		DBManager dbm = new DBManager();

		request.getSession().setAttribute("fei", dbm.getSF());

		if (type.equals("用户")) {
			int uid = dbm.loginYH(username, userpwd);
			if (uid > 0) {
				request.getSession().setAttribute("user", username);
				request.getSession().setAttribute("uid", uid+"");
				request.getSession().setAttribute("type", "用户");
				response.sendRedirect("index.jsp");

			} else {
				out
						.println("<script>alert('用户名或密码有误!');window.location.href='login.jsp'</script>");
			}

		} else if (type.equals("管理员")) {
			boolean login = dbm.login(username, userpwd);
			if (login) {

				request.getSession().setAttribute("user", username);
				request.getSession().setAttribute("type", "管理员");
				response.sendRedirect("index.jsp");

			} else {
				out
						.println("<script>alert('用户名或密码有误!');window.location.href='login.jsp'</script>");
			}
		} else {
			out
					.println("<script>alert('用户名或密码有误!');window.location.href='login.jsp'</script>");
		}

		out.flush();
		out.close();
	}

	/**
	 * Initialization of the servlet. <br>
	 * 
	 * @throws ServletException
	 *             if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}

注册控制器

public class RegUserinfoAction extends HttpServlet {	
	
	/**	
	 * Constructor of the object.	
	 */	
	public RegUserinfoAction() {	
		super();	
	}	
	
	/**	
	 * Destruction of the servlet. <br>	
	 */	
	public void destroy() {	
		super.destroy(); // Just puts "destroy" string in log	
		// Put your code here	
	}	
	
	/**	
	 * The doPost method of the servlet. <br>	
	 *	
	 * This method is called when a form has its tag value method equals to post.	
	 * 	
	 * @param request the request send by the client to the server	
	 * @param response the response send by the server to the client	
	 * @throws ServletException if an error occurred	
	 * @throws IOException if an error occurred	
	 */	
	public void doPost(HttpServletRequest request, HttpServletResponse response)	
			throws ServletException, IOException {	
	
		response.setContentType("text/html;charset=UTF-8");
		PrintWriter out = response.getWriter();	
		String name=request.getParameter("name");
		String pwd=request.getParameter("pwd");
		String age=request.getParameter("age");
		String tel=request.getParameter("tel");
			
		DBManager dbm = new DBManager();	
			
		//用户注册
		String sql = "insert into userinfo(name,pwd,age,tel,jine) values('"+name+"','"+pwd+"','"+age+"','"+tel+"','0')";	
	
		Statement stat = null;	
		Connection conn=null;	
		try {	
			conn=dbm.getConnection();	
			stat = conn.createStatement();	
			System.out.println(sql);	
			stat.execute(sql);	
		} catch (SQLException e) {	
			// TODO Auto-generated catch block	
			e.printStackTrace();	
		} finally {	
			try {	
				if(stat!=null)	
					stat.close();	
				if(conn!=null)	
					conn.close();	
			} catch (SQLException e) {	
				// TODO Auto-generated catch block	
				e.printStackTrace();	
			}	
		}	
		out.println("<script>alert('注册成功请登录!');window.location.href='login.jsp'</script>");
		out.flush();	
		out.close();	
	}	
	
	/**	
	 * Initialization of the servlet. <br>	
	 *	
	 * @throws ServletException if an error occurs	
	 */	
	public void init() throws ServletException {	
		// Put your code here	
	}	
	

如果也想学习本系统,下面领取。回复:030JSP    

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
一、项目简介 本项目是一套基于SSM的旅游管理系统,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的Java学习者。 包含:项目源码、数据库脚本、软件工具、项目说明等,该项目可以直接作为毕设使用。 项目都经过严格调试,确保可以运行! 二、技术实现 ​后台框架:Spring、SpringMVC、MyBatis ​数据库:MySQL 开发环境:JDK、Eclipse、Tomcat 三、系统功能 本系统主要包含了:系统用户管理、景点信息管理、新闻管理、公告文章管理多个功能模块。 下面分别简单阐述一下这几个功能模块需求。 1.登陆注册模块 管理员的登录模块:管理员登录系统对本系统其他管理模块进行管理。 用户的登录模块:用户登录本系统,对个人的信息等进行查询,操作可使用的功能。 用户注册模块:游客用户可以进行用户注册,系统会反馈是否注册成功。 添加管理员模块:向本系统中添加更多的管理人员,管理员包括普通管理员和超级管理员。 2.景点信息管理模块: 景点信息列表:将数据库的景点信息表以列表的形式呈现给管理员。 添加景点信息:实现管理员添加景点信息。 修改景点信息:实现管理员修改景点信息。 3.公告文章管理模块: 公告文章列表:将数据库的公告文章表以列表的形式呈现给管理员。 添加公告文章:实现管理员添加公告文章。 修改公告文章:实现管理员修改公告文章。 4.旅游线路管理模块: 旅游线路列表:显示系统的所有旅游线路,可以通过关键字查询。 旅游线路删除:对输入错误或过期的旅游线路删除。 5.变幻图管理模块: 变幻图列表:显示系统的所有变幻图,可以通过关键字查询。 变幻图删除:对输入错误或过期的变幻图删除。 6.用户模块: 资料管理:用户登录本系统。可以对自己的个人主页进行查看。 系统信息:用户可以查看自己的系统提示信息。 修改资料:用户可以修改自己的账号密码。 信息搜索:用户可以通过关键字搜索站内信息。 密码修改:用户可以修改个人登录密码。 7.系统管理模块:包括数据备份。 8.退出模块: 管理员退出:管理员用来退出系统。 用户退出:用户用来退出系统。 该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值