• web继续走起


    11.23

    今天继续写我的web系统,没遇到什么问题,系统模型已经有了,下面就是完善了,明天计划完善web系统。

    代码部分:

    package com.pp;

    import java.io.IOException;
    import java.sql.SQLException;

    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    /**
    * Servlet implementation class shanchu
    */
    @WebServlet("/shanchu")
    public class shanchu extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
    * @see HttpServlet#HttpServlet()
    */
    public shanchu() {
    super();
    // TODO Auto-generated constructor stub
    }

    /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    String xingming=request.getParameter("xingming");
    dao L=new dao();
    try {
    L.delete(xingming);
    request.getRequestDispatcher("delete.jsp").forward(request, response);
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }

    /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    doGet(request, response);
    }

    }

    package com.pp;

    import java.io.IOException;
    import java.sql.SQLException;

    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    /**
    * Servlet implementation class People
    */
    @WebServlet("/xuesheng")
    public class xuesheng extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
    * @see HttpServlet#HttpServlet()
    */
    public xuesheng() {
    super();
    // TODO Auto-generated constructor stub
    }

    /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    String xuehao=request.getParameter("xuehao");
    String xingming=request.getParameter("xingming");
    String banji=request.getParameter("banji");
    String kecheng=request.getParameter("kecheng");
    String fenshu=request.getParameter("fenshu");

    get login=new get(xuehao,xingming,banji,kecheng,fenshu);
    dao L=new dao();
    try {
    L.insert(login);
    request.getRequestDispatcher("xuesheng.jsp").forward(request, response);
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }

    /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    doGet(request, response);
    }

    }

  • 相关阅读:
    linux的ip配置
    脚本抓取mongoDB慢查询进程,生成kill语句,快速恢复mongodb CPU打满情况
    python脚本生成sql分库分表语句
    脚本获取rds慢日志
    问题反馈小平台实现 ----python练习
    python脚本 监控MySQL slave 状态
    传统复制的复制结构之间转换
    python判断合法IP并区分内网和外网地址
    ELK单台日志收集系统的搭建
    网站程序文件增量更新脚本
  • 原文地址:https://www.cnblogs.com/092e/p/14170043.html
Copyright © 2020-2023  润新知