📄 borrowbookinspectcontrolpro.java
字号:
/***********************************************************************
* 图书管理系统
* Team : ???
* Author:金日新
* StartTime:2006/1/4
* VersionNumber:1.1
* ProgrammeLanguage:java
* Remark:图书借阅控制
*************************************************************************/
package com.controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Hashtable;
import java.util.Vector;
import javax.servlet.RequestDispatcher;
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 com.common.DBaccess.BorrowBookInspectProcess;
public class BorrowBookInspectControlPro extends HttpServlet
{
/**
* 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
{
doPost(request, response);
}
/**
* 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
{
request.setCharacterEncoding("gb2312");
BorrowBookInspectProcess borrow=new BorrowBookInspectProcess();
if(request.getParameter("name").equals("borrowing"))
{
String ZJH=request.getParameter("ZJH");
String SQH=request.getParameter("SQH");
int i=borrow.borrowInspectProcess(ZJH, SQH);
if(i>0)
{
request.setAttribute("title","图书借阅");
request.setAttribute("URL","/admin/view/borrowInspect.jsp");
RequestDispatcher dis=this.getServletContext().getRequestDispatcher("/admin/index.jsp");
dis.forward(request,response);
}
else
{
request.setAttribute("error","借书错误!");
request.setAttribute("title","借书信息");
request.setAttribute("URL","../error/error.jsp");
RequestDispatcher dis=this.getServletContext().getRequestDispatcher("/admin/index.jsp");
dis.forward(request,response);
}
}
if(request.getParameter("name").equals("borrow"))
{
request.setAttribute("title","图书借阅");
request.setAttribute("URL","/admin/view/borrowInspect.jsp");
RequestDispatcher dis=this.getServletContext().getRequestDispatcher("/admin/index.jsp");
dis.forward(request,response);
}
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException
{
// Put your code here
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -