* @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 */ publicvoiddoGet(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 */ publicvoiddoPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(Constant.CONTENTTYPE); request.setCharacterEncoding(Constant.CHARACTERENCODING); HttpSession session = request.getSession(); ComBean cBean = new ComBean(); String date2=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); String method = request.getParameter("method"); if(method.equals("addFenLei")){ //增加科室 ------代码注释 String fl = request.getParameter("bj"); String str=cBean.getString("select id from fenlei where fl='"+fl+"'"); if(str==null){ int flag = cBean.comUp("insert into fenlei(fl) values('"+fl+"')"); if(flag == Constant.SUCCESS){ request.setAttribute("message", "操作成功!"); request.getRequestDispatcher("admin/ys/fenlei.jsp").forward(request, response); } else {
/** * Initialization of the servlet. <br> * * @throws ServletException if an error occure */ publicvoidinit()throws ServletException { // Put your code here }
/** * 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 */ publicvoiddoPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {