Package javax.servlet

Examples of javax.servlet.ServletRequestEvent


                        // request in scope notify
                        ServletRequestListener reqLsnrs[] = webAppConfig.getRequestListeners();
                        for (int n = 0; n < reqLsnrs.length; n++) {
                            ClassLoader cl = Thread.currentThread().getContextClassLoader();
                            Thread.currentThread().setContextClassLoader(webAppConfig.getLoader());
                            reqLsnrs[n].requestInitialized(new ServletRequestEvent(webAppConfig, req));
                            Thread.currentThread().setContextClassLoader(cl);
                        }

                        // Lookup a dispatcher, then process with it
                        processRequest(webAppConfig, req, rsp,
                                webAppConfig.getServletURIFromRequestURI(servletURI));
                        writeToAccessLog(servletURI, req, rsp, webAppConfig);

                        this.outData.finishResponse();
                        this.inData.finishRequest();

                        Logger.log(Logger.FULL_DEBUG, Launcher.RESOURCES,
                                "RequestHandlerThread.FinishRequest",
                                "" + requestId);

                        // Process keep-alive
                        continueFlag = this.listener.processKeepAlive(req, rsp, inSocket);

                        // Set last accessed time on session as start of this
                        // request
                        req.markSessionsAsRequestFinished(this.requestStartTime, this.saveSessions);

                        // send request listener notifies
                        for (int n = 0; n < reqLsnrs.length; n++) {
                            ClassLoader cl = Thread.currentThread().getContextClassLoader();
                            Thread.currentThread().setContextClassLoader(webAppConfig.getLoader());
                            reqLsnrs[n].requestDestroyed(new ServletRequestEvent(webAppConfig, req));
                            Thread.currentThread().setContextClassLoader(cl);                           
                        }

                        req.setWebAppConfig(null);
                        rsp.setWebAppConfig(null);
View Full Code Here


                       ServletResponse response)
    throws ServletException, IOException
  {
    try {
      for (int i = 0; i < _requestListeners.length; i++) {
        ServletRequestEvent event = new ServletRequestEvent(_webApp, request);

        _requestListeners[i].requestInitialized(event);
      }

      _next.doFilter(request, response);
    } finally {
      for (int i = _requestListeners.length - 1; i >= 0; i--) {
        try {
          ServletRequestEvent event = new ServletRequestEvent(_webApp, request);

          _requestListeners[i].requestDestroyed(event);
        } catch (Throwable e) {
          log.log(Level.WARNING, e.toString(), e);
        }
View Full Code Here

    try {
      thread.setContextClassLoader(_classLoader);

      if (webApp != _webApp) {
        for (int i = 0; i < _requestListeners.length; i++) {
          ServletRequestEvent event
            = new ServletRequestEvent(_webApp, request);
         
          _requestListeners[i].requestInitialized(event);
        }
      }
     
      _next.doFilter(request, response);
    } catch (FileNotFoundException e) {
      // server/106c
      /*
      log.log(Level.FINER, e.toString(), e);
     
      HttpServletResponse res = (HttpServletResponse) response;
     
      res.sendError(404);
      */
     
      throw e;
    } finally {
      if (webApp != _webApp) {
        for (int i = _requestListeners.length - 1; i >= 0; i--) {
          ServletRequestEvent event
            = new ServletRequestEvent(_webApp, request);
         
          _requestListeners[i].requestDestroyed(event);
        }
      }

View Full Code Here

        Object instances[] = getApplicationEventListeners();

        if ((instances != null) && (instances.length > 0)) {

            ServletRequestEvent event =
                    new ServletRequestEvent(getServletContext(), request);

            for (int i = 0; i < instances.length; i++) {
                if (instances[i] == null)
                    continue;
                if (!(instances[i] instanceof ServletRequestListener))
View Full Code Here

    public boolean fireRequestDestroyEvent(ServletRequest request) {
        Object instances[] = getApplicationEventListeners();

        if ((instances != null) && (instances.length > 0)) {

            ServletRequestEvent event =
                new ServletRequestEvent(getServletContext(), request);

            for (int i = 0; i < instances.length; i++) {
                int j = (instances.length -1) -i;
                if (instances[j] == null)
                    continue;
View Full Code Here

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    {
        ServletRequestListenerManager requestListener = this.controller.getRequestListener();

        final ServletRequestEvent sre = new ServletRequestEvent(getServletContext(), req);
        requestListener.requestInitialized(sre);
        try
        {
            req = new AttributeEventRequest(getServletContext(), this.controller.getRequestAttributeListener(), req);
            this.controller.getDispatcher().dispatch(req, res);
View Full Code Here

        this.begin = begin;
    }

    public void init() {
        if (begin != null) {
            begin.requestInitialized(new ServletRequestEvent(getServletContext(), this));
        }
    }
View Full Code Here

        }
    }

    public void destroy() {
        if (end != null) {
            end.requestDestroyed(new ServletRequestEvent(getServletContext(), this));
        }
    }
View Full Code Here

        Object instances[] = getApplicationEventListeners();

        if ((instances != null) && (instances.length > 0)) {

            ServletRequestEvent event =
                    new ServletRequestEvent(getServletContext(), request);

            for (int i = 0; i < instances.length; i++) {
                if (instances[i] == null)
                    continue;
                if (!(instances[i] instanceof ServletRequestListener))
View Full Code Here

    public boolean fireRequestDestroyEvent(ServletRequest request) {
        Object instances[] = getApplicationEventListeners();

        if ((instances != null) && (instances.length > 0)) {

            ServletRequestEvent event =
                new ServletRequestEvent(getServletContext(), request);

            for (int i = 0; i < instances.length; i++) {
                int j = (instances.length -1) -i;
                if (instances[j] == null)
                    continue;
View Full Code Here

TOP

Related Classes of javax.servlet.ServletRequestEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.