Package org.tuckey.web.filters.urlrewrite

Examples of org.tuckey.web.filters.urlrewrite.UrlRewriteFilter


public class WikiUrlRewriteFilter extends AbstractFilter {

    private UrlRewriteFilter urlRewriteFilter;

    public void init(FilterConfig filterConfig) throws ServletException {
        urlRewriteFilter = new UrlRewriteFilter();
        urlRewriteFilter.init(new FilterConfigWrapper(filterConfig, getInitParameters()));
    }
View Full Code Here


        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcherServlet", dispatcherServlet);
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping("/site/*");

    UrlRewriteFilter urlRewriteFilter = new UrlRewriteFilter();

    servletContext.addFilter("UrlRewriteFilter", urlRewriteFilter)
      .addMappingForUrlPatterns(
          EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD),
          false, "/*");
 
View Full Code Here

    @Bean
    public FilterRegistrationBean rewriteFilterConfig() {
        FilterRegistrationBean reg = new FilterRegistrationBean();
        reg.setName(REWRITE_FILTER_NAME);
        reg.setFilter(new UrlRewriteFilter());
        reg.addInitParameter("confPath", REWRITE_FILTER_CONF_PATH);
        reg.addInitParameter("confReloadCheckInterval", "-1");
        reg.addInitParameter("statusPath", "/redirect");
        reg.addInitParameter("statusEnabledOnHosts", "*");
        reg.addInitParameter("logLevel", "WARN");
View Full Code Here

    private FilterChain filterChain;

    @Before
    public void setUp() throws Exception {
        UrlRewriteFilter filter =
                createUrlFilter(SiteConfig.REWRITE_FILTER_NAME,
                        SiteConfig.REWRITE_FILTER_CONF_PATH);
        filterChain = new PassThroughFilterChain(filter, new MockFilterChain());
    }
View Full Code Here

                        SiteConfig.REWRITE_FILTER_CONF_PATH);
        filterChain = new PassThroughFilterChain(filter, new MockFilterChain());
    }

    private UrlRewriteFilter createUrlFilter(String filterName, String mappingsFile) throws ServletException {
        UrlRewriteFilter newFilter = new UrlRewriteFilter();
        MockFilterConfig filterConfig = new MockFilterConfig(filterName);
        filterConfig.addInitParameter("confPath", mappingsFile);
        filterConfig.addInitParameter("logLevel", "WARN");
        newFilter.init(filterConfig);
        return newFilter;
    }
View Full Code Here

        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping(DISPATCHER_SERVLET_MAPPING);

        servletContext.addListener(new ContextLoaderListener(rootContext));

        FilterRegistration.Dynamic urlReWrite = servletContext.addFilter(URL_REWRITE_FILTER_NAME, new UrlRewriteFilter());
        urlReWrite.setInitParameter(URL_REWRITE_FILTER_PARAM_LOGLEVEL, URL_REWRITE_FILTER_LOGLEVEL_SLF4J);
        EnumSet<DispatcherType> urlReWriteDispatcherTypes = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD);
        urlReWrite.addMappingForUrlPatterns(urlReWriteDispatcherTypes, true, URL_REWRITE_FILTER_MAPPING);
    }
View Full Code Here

TOP

Related Classes of org.tuckey.web.filters.urlrewrite.UrlRewriteFilter

Copyright © 2018 www.massapicom. 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.