⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deleteservlet.java

📁 图书管理
💻 JAVA
字号:
package library;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.*;
import javax.servlet.http.*;

public class DeleteServlet extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html; charset=GBK";
    BookInfo bookInfo;
    AuthorInfo authorInfo;
    BookModel bookModel;
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        bookInfo = new BookInfo();
        authorInfo = new AuthorInfo();
        bookModel = new BookModel();
    }

    /**
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void doGet(HttpServletRequest request, 
                       HttpServletResponse response) throws ServletException, IOException {response.setContentType(CONTENT_TYPE);
        request.setCharacterEncoding("gb2312");
        String bookNum = (String)request.getParameter("bookNum");
        String authorNum = (String)request.getParameter("authorNum");
        bookInfo.setBookNum(bookNum);
        authorInfo.setAuthorNum(authorNum);
        bookModel.IsDeleteAuthor(bookInfo,authorInfo);
        request.setAttribute("rs",bookModel.Query());
        getServletContext().getRequestDispatcher("/Login_success.jsp").forward(request,response);
    }
    public void doPost(HttpServletRequest request, 
                       HttpServletResponse response) throws ServletException, IOException{
        doGet(request,response);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -