基于javaweb+JSP+Servlet火车票网上订票系统(前台、后台)

基于javaweb+JSP+Servlet火车票网上订票系统(前台、后台)

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

public class Add extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public Add() {
		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
		JSONObject json=new JSONObject();
		if(utype==null||userid==null){
			json.put("msg", "请重新登陆");
		}else{
			String opwd=request.getParameter("opwd");
			String npwd=request.getParameter("npwd");
			DbConn db=new DbConn();
			String sql="";
			if("gly".equals(utype.toString())){
				sql="select id from userinfo where id="+userid+" and upassword='"+opwd+"'";
			}else if("cus".equals(utype.toString())){
				sql="select id from cusinfo where id="+userid+" and cpassword='"+opwd+"'";
			}
			boolean bl=false;
			if("".equals(sql)){
				json.put("msg", "系统错误01");
			}else{
				bl=db.checkTrue(sql);
			}
			if(bl){
				if("gly".equals(utype.toString())){
					sql="update userinfo set upassword='"+npwd+"' where id="+userid;
				}else if("cus".equals(utype.toString())){
					sql="update cusinfo set cpassword='"+npwd+"' where id="+userid;
				}
				int bls=db.deleteOrUpdate(sql);
				if(bls>0){
    }
    #lose span{
        background:url(images/bd-set.png) no-repeat -140px 0px;
    }
  </style>
  </head>
  <body scroll="no">
 
  	 <div id="header">
    <div class="logo-left l">
        
    </div>
    <div class="center-cont l">
        <ul>
            <li><a href="<%=basePath %>/admin/login.jsp">火车网上订票系统后台管理</a></li>
            <li><a href="<%=basePath %>">首页</a></li>
           
        </ul>
    </div>
    <div class="set-up r">
        <a href="" id="name"><span></span>用户名:${username }</a>
        <a href="<%=basePath %>changePwd.jsp" target="page" id="setup"><span></span>修改密码</a>
        <a href="" id="help" target="_blank"><span></span>首页</a>
        <a href="<%=basePath %>LogoutSvlt?flag=gly" id="lose"><span></span>注销</a>
    </div>
}
package dp.admin.svlt;

import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import dp.utils.DbConn;
import net.sf.json.JSONObject;

public class Add extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public Add() {
    <base href="<%=basePath%>">
    
    <title>车票信息管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/cstype.css">
	<link href="<%=basePath %>css/jquery.ui.core.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>css/jquery.ui.datepicker.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>css/jquery.ui.theme.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="<%=basePath %>css/mytable.css">
	<script type="text/javascript" src="<%=basePath %>js/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/jquery.ui.core.js"></script>
	     * @param key key值
	     * @return key 键对应的值 
	     * @throws IOException 
	     */
	    public void setValue(String key,String value) throws IOException {
	        Properties prop = new Properties();
	        InputStream fis = new FileInputStream(this.configPath);
	        // 从输入流中读取属性列表(键和元素对)
	        prop.load(fis);
	        // 调用 Hashtable 的方法 put。使用 getProperty 方法提供并行性。
	        // 强制要求为属性的键和值使用字符串。返回值是 Hashtable 调用 put 的结果。
	        OutputStream fos = new FileOutputStream(this.configPath);
	        prop.setProperty(key, value);
	        // 以适合使用 load 方法加载到 Properties 表中的格式,
	        // 将此 Properties 表中的属性列表(键和元素对)写入输出流
	        prop.store(fos,"last update");
	        //关闭文件
	        fis.close();
	        fos.close();
	    }
}
package dp.svlt;

                <td id="td2" style="height: 60px; text-align: center;">
                    <div id="div3" style="position: absolute; left: 0px; top: 0px; width: 600px; height: 60px; font-family:Comic Sans MS; color: #000000;">
                    </div>
                    <div id="div4" style="position: absolute; left: 0px; top: 0px; width: 600px; height: 60px; font-family:Comic Sans MS; color: #FFFFFF;">
                    </div>
                </td>
            </tr>
        </table>
    </div> 
    <input type="hidden" id="utype" value="gly"/>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

		}
		//线路信息初始化
		if("initxl".equals(tname)){
			if("1".equals(flgs)){
				sql="select * from traininfo";
				hp.setValue("sql", sql);
			}else{
				sql=hp.readValue("sql");
			}
			List<Xianlu> xllist=new ArrayList();
			DbConn db2=new DbConn();
			ResultSet rs=db.query(sql);
			List<Traininfo> tlist=FindService.getTraininfo(rs);

public class RegSvlt extends HttpServlet {

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

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
	/**
	 * Constructor of the object.
	 */
	public LoginSvlt() {
		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

运行环境

Java≥8、Tomcat≥8.0、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JSP Servlet MySQL JDBC Tomcat CSS JavaScript

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

前台功能:用户查询车票信息、登录注册、购票、查看已购车票、修改密码等功能。

后台功能:管理员管理、用户管理、火车信息管理、站点信息管理、线路信息管理、车票信息管理、购票信息管理等。

20220312190835

后台:

20220312185831

20220312185856

20220312190003

20220312190015

20220312190023

20220312190034

20220312190051

20220312190055

20220312190353

20220312190418

前台

20220312190445

20220312190542

20220312190643

20220312190703

20220312190713


  • 4
    点赞
  • 57
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
好的,我可以给你简单介绍一下一个基于Javaweb的Spring+jsp+Servlet+MySql的超市订单管理系统的大致架构和功能模块。 该系统主要分为前台后台两个部分,前台是顾客使用的界面,可以进行商品浏览、购物车管理、订单提交等操作;后台是管理员使用的界面,可以进行商品管理、订单管理、用户管理等操作。 系统的技术架构主要采用Spring框架作为整个项目的基础框架,集成了MyBatis持久化框架、SpringMVC框架和Shiro安全框架等技术,通过Maven进行项目管理和依赖管理,使用Tomcat作为Web服务器,最终实现了一个高效、稳定、安全、易于维护的超市订单管理系统。 下面简单列举一下系统的功能模块: 1. 用户注册和登录:用户可以通过注册账号并登录系统来进行商品浏览、购物车管理、订单提交等操作。 2. 商品管理:管理员可以在后台管理界面中管理商品信息,包括商品的添加、修改、删除、查询等操作。 3. 订单管理:管理员可以在后台管理界面中管理订单信息,包括订单的查询、修改、删除等操作。 4. 用户管理:管理员可以在后台管理界面中管理用户信息,包括用户的查询、添加、修改、删除等操作。 5. 购物车管理:用户可以将感兴趣的商品添加到购物车中,也可以在购物车中修改、删除商品信息。 6. 支付和发货:用户可以在确认订单信息无误后进行支付操作,管理员可以在后台管理界面中进行订单发货操作。 7. 安全权限控制:系统通过Shiro框架实现了对用户登录和权限控制的安全管理,确保系统的数据安全性和稳定性。 以上仅是系统的简单介绍,具体的实现和细节还需要根据具体的需求进行设计和开发。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值