Java 类org.springframework.web.filter.HttpPutFormContentFilter 实例源码

项目:backbone    文件:ApplicationInitializer.java   
@Override
protected Filter[] getServletFilters() {
    CharacterEncodingFilter filter1 = new CharacterEncodingFilter();
    filter1.setEncoding("utf-8");
    filter1.setForceEncoding(true);

    HttpPutFormContentFilter filter2 = new HttpPutFormContentFilter();
    HiddenHttpMethodFilter filter3 = new HiddenHttpMethodFilter();

    LOG.info("Adding filter to dispatcher servlet[CharacterEncodingFilter,HttpPutFormContentFilter,HiddenHttpMethodFilter]");
    return new Filter[]{filter1, filter2, filter3};
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcAutoConfigurationTests.java   
@Test
public void httpPutFormContentFilterCanBeOverridden() {
    load(CustomHttpPutFormContentFilter.class);
    assertThat(this.context.getBeansOfType(OrderedHttpPutFormContentFilter.class))
            .hasSize(0);
    assertThat(this.context.getBeansOfType(HttpPutFormContentFilter.class))
            .hasSize(1);
}
项目:nbone    文件:SpringWebApplicationInitializer.java   
/**
 * <p>默认关闭<p>
 * 注意:需放在initHiddenHttpMethodFilter之后
 * @param servletContext
 * @see HttpPutFormContentFilter
 */
protected void initHttpPutFormContentFilter(ServletContext servletContext){
    String enablePutForm  = servletContext.getInitParameter("enablePutForm");
    if(BooleanUtils.valueOf(enablePutForm)){
        //HttpPutFormContentFilter  
        HttpPutFormContentFilter httpPutFormContentFilter =  new HttpPutFormContentFilter();

        FilterRegistration filterRegistration =  servletContext.addFilter("httpPutFormContentFilter", httpPutFormContentFilter);

        filterRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, "/*");
    }
}
项目:spring-boot-concourse    文件:WebMvcAutoConfigurationTests.java   
@Test
public void httpPutFormContentFilterCanBeOverridden() {
    load(CustomHttpPutFormContentFilter.class);
    assertThat(this.context.getBeansOfType(OrderedHttpPutFormContentFilter.class))
            .hasSize(0);
    assertThat(this.context.getBeansOfType(HttpPutFormContentFilter.class))
            .hasSize(1);
}
项目:contestparser    文件:WebMvcAutoConfigurationTests.java   
@Test
public void httpPutFormContentFilterCanBeOverridden() {
    load(CustomHttpPutFormContentFilter.class);
    assertThat(
            this.context.getBeansOfType(OrderedHttpPutFormContentFilter.class).size(),
            is(equalTo(0)));
    assertThat(this.context.getBeansOfType(HttpPutFormContentFilter.class).size(),
            is(equalTo(1)));
}
项目:spacesimulator2    文件:WebAppConfig.java   
@Override
protected Filter[] getServletFilters() {
    CharacterEncodingFilter charFilter = new CharacterEncodingFilter();
    charFilter.setEncoding("UTF-8");
    charFilter.setForceEncoding(true);
    return new Filter[] { new HiddenHttpMethodFilter(), charFilter, new HttpPutFormContentFilter() };
}
项目:bearchoke    文件:AbstractWebApplicationInitializer.java   
protected void createFilters(ServletContext ctx) {
        CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
        characterEncodingFilter.setEncoding("UTF-8");

        SimpleCORSFilter corsFilter = new SimpleCORSFilter();
        corsFilter.setCorsAllowCredentials("true");
        corsFilter.setCorsAllowMethods("GET, POST, PUT, PATCH, DELETE, OPTIONS");
        corsFilter.setCorsAllowHeaders("content-type, x-requested-with, origin, accept, authorization, username, password, x-app-type, x-app-version, x-auth-token, soapaction");
        corsFilter.setCorsExposeHeaders("content-type, cookie, x-requested-with, origin, accept, username, password, x-app-type, x-app-version, x-auth-token, soapaction");
        corsFilter.setCorsMaxAge("3600");

        ctx.addFilter("springSessionRepositoryFilter", DelegatingFilterProxy.class).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
        ctx.addFilter("simpleCORSFilter", DelegatingFilterProxy.class).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
//        ctx.addFilter("SimpleCorsFilter", corsFilter).addMappingForUrlPatterns(
//                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
        ctx.addFilter("JsonHttpRequestFilter", new JsonHttpRequestFilter()).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, "/api/authenticate");
        ctx.addFilter("springSecurityFilterChain", DelegatingFilterProxy.class).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
        ctx.addFilter("CharacterEncodingFilter", characterEncodingFilter).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
        ctx.addFilter("HiddenHttpMethodFilter", new HiddenHttpMethodFilter()).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
        ctx.addFilter("HttpPutFormContentFilter", new HttpPutFormContentFilter()).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);
        ctx.addFilter("ShallowEtagHeaderFilter", new ShallowEtagHeaderFilter()).addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, FILTER_MAPPING);

    }
项目:spacesimulator    文件:WebApp.java   
@Override
protected Filter[] getServletFilters() {
    CharacterEncodingFilter charFilter = new CharacterEncodingFilter();
    charFilter.setEncoding("UTF-8");
    charFilter.setForceEncoding(true);
    return new Filter[] { new HiddenHttpMethodFilter(), charFilter,
        new HttpPutFormContentFilter() };
}
项目:spring-backend-boilerplate    文件:OpenApiWebMvcConfigurer.java   
@Bean(name = "httpMethodFilter")
public Filter httpMethodFilter() {
    return new HttpPutFormContentFilter();
}
项目:spring-backend-boilerplate    文件:OpenApiWebMvcConfigurer.java   
@Bean(name = "httpMethodFilter")
public Filter httpMethodFilter() {
    return new HttpPutFormContentFilter();
}
项目:websecuredemo    文件:XssDemoApplication.java   
@Bean
public HttpPutFormContentFilter httpPutFormContentFilter() {
    HttpPutFormContentFilter filter = new HttpPutFormContentFilter();
    filter.setCharset(Charset.forName("utf-8"));
    return filter;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(HttpPutFormContentFilter.class)
public OrderedHttpPutFormContentFilter httpPutFormContentFilter() {
    return new OrderedHttpPutFormContentFilter();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcAutoConfigurationTests.java   
@Bean
public HttpPutFormContentFilter customHttpPutFormContentFilter() {
    return new HttpPutFormContentFilter();
}
项目:spring-boot-concourse    文件:WebMvcAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(HttpPutFormContentFilter.class)
public OrderedHttpPutFormContentFilter httpPutFormContentFilter() {
    return new OrderedHttpPutFormContentFilter();
}
项目:spring-boot-concourse    文件:WebMvcAutoConfigurationTests.java   
@Bean
public HttpPutFormContentFilter customHttpPutFormContentFilter() {
    return new HttpPutFormContentFilter();
}
项目:contestparser    文件:WebMvcAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(HttpPutFormContentFilter.class)
public OrderedHttpPutFormContentFilter httpPutFormContentFilter() {
    return new OrderedHttpPutFormContentFilter();
}
项目:contestparser    文件:WebMvcAutoConfigurationTests.java   
@Bean
public HttpPutFormContentFilter customHttpPutFormContentFilter() {
    return new HttpPutFormContentFilter();
}