code: public void processException(HttpServletRequest req, HttpServletResponse res) throws IOException
      {
          if (redirectURL != null)
          {
              res.sendRedirect(redirectURL);
              return;
          }
          
          if (message == null)
          {
              res.sendError(statusCode);
          }
          else
          {
              res.sendError(statusCode, message);
          }
      }
docs: Process security violation exception
  @param req - Http servlet request object
  @param res - Http servlet response object
  @throws IOException if error, otherwise redirects to appropriate error or login page