Search in sources :

Example 51 with HttpServletRequestWrapper

use of javax.servlet.http.HttpServletRequestWrapper in project processdash by dtuma.

the class WebAppContextDashboard method doHandle.

@Override
public void doHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    HttpServletRequest wrappedRequest = new HttpServletRequestWrapper((HttpServletRequest) Proxy.newProxyInstance(WebAppContextDashboard.class.getClassLoader(), new Class[] { HttpServletRequest.class }, new PrivilegedInvoker(request)));
    IgnoreResponseErrors ignoreErr = new IgnoreResponseErrors((HttpServletResponse) Proxy.newProxyInstance(WebAppContextDashboard.class.getClassLoader(), new Class[] { HttpServletResponse.class }, new PrivilegedInvoker(response)));
    super.doHandle(target, baseRequest, wrappedRequest, ignoreErr);
    if (ignoreErr.ignored)
        baseRequest.setHandled(false);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HttpServletRequestWrapper(javax.servlet.http.HttpServletRequestWrapper)

Aggregations

HttpServletRequestWrapper (javax.servlet.http.HttpServletRequestWrapper)51 HttpServletRequest (javax.servlet.http.HttpServletRequest)40 HttpServletResponse (javax.servlet.http.HttpServletResponse)17 ServletRequest (javax.servlet.ServletRequest)12 ServletResponse (javax.servlet.ServletResponse)10 IOException (java.io.IOException)9 FilterChain (javax.servlet.FilterChain)9 Test (org.junit.Test)9 ServletException (javax.servlet.ServletException)8 HttpServletResponseWrapper (javax.servlet.http.HttpServletResponseWrapper)8 Principal (java.security.Principal)6 FilterConfig (javax.servlet.FilterConfig)6 ArrayList (java.util.ArrayList)5 Filter (javax.servlet.Filter)5 Provider (com.google.inject.Provider)4 ServletTestUtils.newFakeHttpServletRequest (com.google.inject.servlet.ServletTestUtils.newFakeHttpServletRequest)4 ServletTestUtils.newFakeHttpServletResponse (com.google.inject.servlet.ServletTestUtils.newFakeHttpServletResponse)4 OutputStream (java.io.OutputStream)4 Cookie (javax.servlet.http.Cookie)4 Injector (com.google.inject.Injector)2