コード例 #1
0
ファイル: AlertServlet.java プロジェクト: sol2014/haircandy
  /**
   * This action deletes all alerts from the system.
   *
   * @param userSession the user session that is performing the action.
   * @param request the http request object related to the action.
   * @param response the http response object related to the action.
   * @throws javax.servlet.ServletException
   * @throws java.io.IOException
   */
  public void performDeleteAll(
      UserSession userSession, HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    LogController.write(this, "[USER REQUEST] Performing all alert delete.");

    SessionController.deleteAlerts(userSession);

    forward("welcome-employee.jsp", request, response);
  }
コード例 #2
0
ファイル: AlertServlet.java プロジェクト: sol2014/haircandy
  /**
   * This action deletes a single alert from the system.
   *
   * @param userSession the user session that is performing the action.
   * @param request the http request object related to the action.
   * @param response the http response object related to the action.
   * @throws javax.servlet.ServletException
   * @throws java.io.IOException
   */
  public void performDelete(
      UserSession userSession, HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String alert_no = request.getParameter("alert_no");

    LogController.write(this, "[USER REQUEST] Performing alert delete: " + alert_no);

    AlertBean alert = new AlertBean();

    try {
      alert.setAlertNo(Integer.parseInt(alert_no));
    } catch (Exception e) {
      LogController.write(this, "Received invalid value for alert number: " + alert_no);
      return;
    }

    SessionController.deleteAlert(userSession, alert);

    forward("welcome-employee.jsp", request, response);
  }