Esempio n. 1
0
 /**
  * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
  *
  * @param request servlet request
  * @param response servlet response
  * @throws ServletException if a servlet-specific error occurs
  * @throws IOException if an I/O error occurs
  */
 protected void processRequest(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
   response.setContentType("text/html;charset=UTF-8");
   String title = request.getParameter("title");
   HttpSession session = request.getSession();
   String uid = (String) session.getAttribute("username");
   DBCommand commander = new DBCommand();
   commander.deleteFromLibrary(title, uid);
   RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/viewprofile.jsp");
   dispatcher.forward(request, response);
 }