code:     protected void forwardToErrorPage(Request request,
              HttpServletResponse response, LoginConfig config)
              throws IOException {
  
          String errorPage = config.getErrorPage();
          if (errorPage == null || errorPage.length() == 0) {
              String msg = sm.getString("formAuthenticator.noErrorPage",
                      context.getName());
              log.warn(msg);
              response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                      msg);
              return;
          }
  
          RequestDispatcher disp =
              context.getServletContext().getRequestDispatcher
              (config.getErrorPage());
          try {
              if (context.fireRequestInitEvent(request)) {
                  disp.forward(request.getRequest(), response);
                  context.fireRequestDestroyEvent(request);
              }
          } catch (Throwable t) {
              ExceptionUtils.handleThrowable(t);
              String msg = sm.getString("formAuthenticator.forwardErrorFail");
              log.warn(msg, t);
              request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
              response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                      msg);
          }
      }
  
  
      /**
       * Does this request match the saved one (so that it must be the redirect
       * we signaled after successful authentication?
       *
       * @param request The request to be verified
       * @return <code>true</code> if the requests matched the saved one
       */
  