Package javax.servlet

Examples of javax.servlet.Filter.doFilter()


        if (pos.get() < n) {
            FilterConfigImpl filterConfig = filters[pos.getAndIncrement()];
            Filter filter = null;
            try {
                filter = filterConfig.getFilter();
                filter.doFilter(request, response, this);
            } catch (IOException e) {
                throw e;
            } catch (ServletException e) {
                throw e;
            } catch (RuntimeException e) {
View Full Code Here


        if (this.current < this.filters.length) {

            // continue filtering with the next filter
            Filter filter = this.filters[this.current];
            trackFilter(slingRequest, filter);
            filter.doFilter(slingRequest, slingResponse, this);

        } else {

            this.render(slingRequest, slingResponse);
View Full Code Here

            if (filter instanceof AbstractFilter)
            {
               AbstractFilter bf = (AbstractFilter) filter;
               if ( bf.isMappedToCurrentRequestPath(request) )
               {
                  filter.doFilter(request, response, this);
               }
               else
               {
                  this.doFilter(request, response);
               }
View Full Code Here

                  this.doFilter(request, response);
               }
            }           
            else
            {
               filter.doFilter(request, response, this);
            }
         }
         else
         {
            chain.doFilter(request, response);
View Full Code Here

    MDC.clear();
    Filter filter = new MDCFilter();
    filter.init(null);

    filter.doFilter(request, response, chain);
    Assert.assertTrue(invoked.get());
    Assert.assertNull(MDC.get("hostname"));
    Assert.assertNull(MDC.get("user"));
    Assert.assertNull(MDC.get("method"));
    Assert.assertNull(MDC.get("path"));
View Full Code Here

        Assert.assertEquals(MDC.get("method"), "METHOD");
        Assert.assertEquals(MDC.get("path"), "/pathinfo");
        invoked.set(true);
      }
    };
    filter.doFilter(request, response, chain);
    Assert.assertTrue(invoked.get());

    HostnameFilter.HOSTNAME_TL.set("HOST");

    invoked.set(false);
View Full Code Here

        Assert.assertEquals(MDC.get("method"), "METHOD");
        Assert.assertEquals(MDC.get("path"), "/pathinfo");
        invoked.set(true);
      }
    };
    filter.doFilter(request, response, chain);
    Assert.assertTrue(invoked.get());

    HostnameFilter.HOSTNAME_TL.remove();

    filter.destroy();
View Full Code Here

    };

    Filter filter = new HostnameFilter();
    filter.init(null);
    Assert.assertNull(HostnameFilter.get());
    filter.doFilter(request, response, chain);
    Assert.assertTrue(invoked.get());
    Assert.assertNull(HostnameFilter.get());
    filter.destroy();
  }
View Full Code Here

                    SecurityUtil.doAsPrivilege
                        ("doFilter", filter, classType, args);
                   
                    args = null;
                } else
                    filter.doFilter(request, response, this);
                }

                support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                                          filter, request, response);
            } catch (IOException e) {
View Full Code Here

        t.addThreadCleanupListener(l);

        HttpServletRequest request = new MockRequest();

        f.doFilter(request, new MockResponse(), new MockFilterChain());

        assertSame(r, HiveMindFilter.getRegistry(request));

        assertEquals(true, l.getCleanup());
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.