Search in sources :

Example 16 with ServletRequestEvent

use of javax.servlet.ServletRequestEvent in project tomee by apache.

the class HttpRequestImpl method init.

public void init() {
    if (begin != null && getAttribute("openejb_requestInitialized") == null) {
        // if called again we loose the request scope
        setAttribute("openejb_requestInitialized", "ok");
        begin.requestInitialized(new ServletRequestEvent(getServletContext(), this));
    }
    listeners = LightweightWebAppBuilderListenerExtractor.findByTypeForContext(contextPath, ServletRequestListener.class);
    if (!listeners.isEmpty()) {
        final ServletRequestEvent event = new ServletRequestEvent(getServletContext(), this);
        for (final ServletRequestListener listener : listeners) {
            listener.requestInitialized(event);
        }
    }
}
Also used : ServletRequestListener(javax.servlet.ServletRequestListener) ServletRequestEvent(javax.servlet.ServletRequestEvent)

Aggregations

ServletRequestEvent (javax.servlet.ServletRequestEvent)16 Test (org.junit.Test)9 ServletRequestListener (javax.servlet.ServletRequestListener)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 MockRunnable (org.springframework.core.task.MockRunnable)3 MockHttpServletRequest (org.springframework.mock.web.test.MockHttpServletRequest)3 MockServletContext (org.springframework.mock.web.test.MockServletContext)3 File (java.io.File)2 HttpSession (javax.servlet.http.HttpSession)2 HttpSessionBindingEvent (javax.servlet.http.HttpSessionBindingEvent)2 ServletsMockitoUtil.createHttpSessionBindingEvent (jodd.petite.ServletsMockitoUtil.createHttpSessionBindingEvent)2 ServletsMockitoUtil.createServletRequestEvent (jodd.petite.ServletsMockitoUtil.createServletRequestEvent)2 Ses (jodd.petite.tst.Ses)2 RequestContextListener (jodd.servlet.RequestContextListener)2 ContextHandler (org.eclipse.jetty.server.handler.ContextHandler)2 MultiPartInputStreamParser (org.eclipse.jetty.util.MultiPartInputStreamParser)2 ApplicationListeners (io.undertow.servlet.core.ApplicationListeners)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 ServletContext (javax.servlet.ServletContext)1