• 第二阶段:团队开发Fooks第一天


    今天和团队对第二阶段项目的实现目标做了设计,进行了分工,本人对项目的结构进行了熟悉 (毕竟有一段时间了),写了对文档进行删除的Servlet部分。

    package Servlet;
    
    import java.io.IOException;
    import java.io.PrintWriter;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import dao.dao;
    import entity.Book;
    import net.sf.json.JSONObject;
    
    
    public class DeleteBookServlet extends HttpServlet {
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            request.setCharacterEncoding("utf-8");
            response.setCharacterEncoding("utf-8");
            response.setContentType("text/html; charset=utf-8");
            String bookname =request.getParameter("bookname");
            String bookpath =request.getParameter("bookpath");
            String createuser=request.getParameter("createuser");
            String createdate=request.getParameter("createdate");
            Book book =new Book(bookname,bookpath,createuser,createdate);
            dao dao =new dao();
            PrintWriter out = response.getWriter();
            JSONObject json=new JSONObject();
            if(dao.delete(book)) {
                json.put("result", 1);
                out.print(json);
            }else {
                json.put("result", 0);
                out.print(json);
            }
        }
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
            doGet(request, response);
        }
    
    }
    DeleteBookServlet.java
  • 相关阅读:
    exploded archive 和packaged archive 区别
    MyEclipse6.5使用设置技巧及快捷键
    本机上设置域名解析
    Cookie的生命周期问题
    简单的函数柯里化
    cookie操作
    自定义事件
    解耦应用逻辑/事件处理程序
    dragdrop + 自定义事件
    在窃取函数中用作用域安全的构造函数
  • 原文地址:https://www.cnblogs.com/yeyueweiliang/p/12926293.html
Copyright © 2020-2023  润新知