Example usage for javax.servlet ServletRequestListener requestInitialized

List of usage examples for javax.servlet ServletRequestListener requestInitialized

Introduction

In this page you can find the example usage for javax.servlet ServletRequestListener requestInitialized.

Prototype

default public void requestInitialized(ServletRequestEvent sre) 

Source Link

Document

Receives notification that a ServletRequest is about to come into scope of the web application.

Usage

From source file:com.jsmartframework.web.manager.RequestControl.java

@Override
public void requestInitialized(ServletRequestEvent event) {
    requestContextListener.requestInitialized(event);

    for (ServletRequestListener requestListener : HANDLER.requestListeners) {
        HANDLER.executeInjection(requestListener);
        requestListener.requestInitialized(event);
    }/*from  w  ww . j  a v  a2  s  .  c o m*/
}

From source file:org.ireland.jnetty.dispatch.filterchain.ServletRequestListenerFilterChain.java

/**
 * Invokes the next filter in the chain or the final servlet at the end of the chain.
 * //from   www . java 2s .co m
 * @param request
 *            the servlet request
 * @param response
 *            the servlet response
 * @since Servlet 2.3
 */
@Override
public void doFilter(ServletRequest request, ServletResponse response) throws ServletException, IOException {
    try {
        //?ServletRequestListener#requestInitialized
        for (ServletRequestListener listener : _requestListeners) {
            ServletRequestEvent event = new ServletRequestEvent(_webApp, request);

            listener.requestInitialized(event);
        }

        _next.doFilter(request, response);
    } finally {
        //?ServletRequestListener#requestDestroyed
        for (int i = _requestListeners.size() - 1; i >= 0; i--) {
            try {
                ServletRequestEvent event = new ServletRequestEvent(_webApp, request);

                _requestListeners.get(i).requestDestroyed(event);
            } catch (Throwable e) {
                log.warn(e.toString(), e);
            }
        }
    }
}