Package javax.servlet

Examples of javax.servlet.FilterChain.doFilter()


        HttpServletResponse response = (HttpServletResponse) newMock(HttpServletResponse.class);
        FilterChain chain = (FilterChain) newMock(FilterChain.class);

        request.setAttribute(HiveMindFilter.REQUEST_KEY, r);

        chain.doFilter(request, response);

        request.getAttribute(HiveMindFilter.REBUILD_REQUEST_KEY);
        requestControl.setReturnValue(null);

        request.getAttribute(HiveMindFilter.REQUEST_KEY);
View Full Code Here


            Filter[] filters = requestFilterChain.getFilters();
            if (filters != null) {
                FilterChain processor = new RequestSlingFilterChain(this,
                    filters);

                processor.doFilter(request, response);

            } else {

                // no filters, directly call resource level filters and servlet
                processRequest(request, response);
View Full Code Here

        Filter filters[] = innerFilterChain.getFilters();
        if (filters != null) {
            FilterChain processor = new SlingComponentFilterChain(filters);

            processor.doFilter(request, response);
        } else {
            log.debug("service: No Resource level filters, calling servlet");
            RequestData.service(request, response);
        }
    }
View Full Code Here

            // Do the filter/handling thang
            if (servlet_holder!=null)
            {
                base_request.setHandled(true);
                if (chain!=null)
                    chain.doFilter(request, response);
                else
                    servlet_holder.handle(request,response);
            }
            else
                notFound(request, response);
View Full Code Here

            // Do the filter/handling thang
            if (servlet_holder!=null)
            {
                base_request.setHandled(true);
                if (chain!=null)
                    chain.doFilter(request, response);
                else
                    servlet_holder.handle(request,response);
            }
            else
                notFound(request, response);
View Full Code Here

                    public Object answer(InvocationOnMock inv) throws Throwable {
                        Object[] args = inv.getArguments();
                        FilterChain fc = (FilterChain) args[2];
                        HttpServletRequestWrapper extraWrapper =
                                new HttpServletRequestWrapper((HttpServletRequest) args[0]);
                        fc.doFilter(extraWrapper, (HttpServletResponse) args[1]);
                        return null;
                    }
                }).when(filter).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class), any(FilterChain.class));
        fcp = new FilterChainProxy(new DefaultSecurityFilterChain(matcher, Arrays.asList(filter)));
        fcp.setFilterChainValidator(mock(FilterChainProxy.FilterChainValidator.class));
View Full Code Here

            public Object answer(InvocationOnMock inv) throws Throwable {
                TestingAuthenticationToken expected = new TestingAuthenticationToken("username", "password");
                SecurityContextHolder.getContext().setAuthentication(expected);
                doAnswer(new Answer<Object>() {
                    public Object answer(InvocationOnMock inv) throws Throwable {
                        innerChain.doFilter(request, response);
                        return null;
                    }
                }).when(filter).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class), any(FilterChain.class));;
                fcp.doFilter(request, response, innerChain);
                assertSame(expected, SecurityContextHolder.getContext().getAuthentication());
View Full Code Here

        expect((Filter)injector.getInstance(key2a)).andReturn(filter2a);
        filter2a.doFilter(same(request), same(response), anyObject(FilterChain.class));
        expect((Filter)injector.getInstance(key2b)).andReturn(filter2b);
        filter2b.doFilter(same(request), same(response), anyObject(FilterChain.class));
        originalChain.doFilter(request, response);

        ctrl.replay();

        SimpleFilterChainResolver underTest = new SimpleFilterChainResolver(chainMap, injector, patternMatcher);
View Full Code Here

        SimpleFilterChainResolver underTest = new SimpleFilterChainResolver(chainMap, injector, patternMatcher);

        FilterChain got = underTest.getChain(request, response, originalChain);

        got.doFilter(request, response);
        got.doFilter(request, response);
        got.doFilter(request, response);

        ctrl.verify();
View Full Code Here

        SimpleFilterChainResolver underTest = new SimpleFilterChainResolver(chainMap, injector, patternMatcher);

        FilterChain got = underTest.getChain(request, response, originalChain);

        got.doFilter(request, response);
        got.doFilter(request, response);
        got.doFilter(request, response);

        ctrl.verify();

        ctrl.reset();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.