Java 类org.springframework.web.multipart.support.StandardServletMultipartResolver 实例源码

项目:jrest    文件:JRestTestApplication.java   
@Bean
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver() {
        @Override
        public boolean isMultipart(HttpServletRequest request) {
            String method = request.getMethod().toLowerCase();
            // By default, only POST is allowed. Since this is an 'update'
            // we should accept PUT.
            if (!Arrays.asList("put", "post").contains(method)) {
                return false;
            }
            String contentType = request.getContentType();
            return (contentType != null && contentType.toLowerCase().startsWith("multipart/"));
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNothing() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNothing.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    verify404();
    assertThat(servlet.getMultipartResolver()).isNotNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartJettyConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartJetty.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    assertThat(servlet.getMultipartResolver()).isNotNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
    verifyServletWorks();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartUndertowConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartUndertow.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    verifyServletWorks();
    assertThat(servlet.getMultipartResolver()).isNotNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartTomcatConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartTomcat.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    assertThat(servlet.getMultipartResolver()).isNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
    verifyServletWorks();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartJettyConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingJetty.class, BaseConfiguration.class);
    this.context.getBean(MultipartConfigElement.class);
    assertThat(this.context.getBean(StandardServletMultipartResolver.class)).isSameAs(
            this.context.getBean(DispatcherServlet.class).getMultipartResolver());
    verifyServletWorks();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartTomcatConfiguration() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingTomcat.class, BaseConfiguration.class);
    new RestTemplate().getForObject("http://localhost:"
            + this.context.getEmbeddedServletContainer().getPort() + "/",
            String.class);
    this.context.getBean(MultipartConfigElement.class);
    assertThat(this.context.getBean(StandardServletMultipartResolver.class)).isSameAs(
            this.context.getBean(DispatcherServlet.class).getMultipartResolver());
    verifyServletWorks();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartUndertowConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingUndertow.class, BaseConfiguration.class);
    this.context.getBean(MultipartConfigElement.class);
    verifyServletWorks();
    assertThat(this.context.getBean(StandardServletMultipartResolver.class)).isSameAs(
            this.context.getBean(DispatcherServlet.class).getMultipartResolver());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithCustomMultipartResolver() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithCustomMultipartResolver.class, BaseConfiguration.class);
    MultipartResolver multipartResolver = this.context
            .getBean(MultipartResolver.class);
    assertThat(multipartResolver)
            .isNotInstanceOf(StandardServletMultipartResolver.class);
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNothing() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNothing.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    verify404();
    assertThat(servlet.getMultipartResolver()).isNotNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartJettyConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartJetty.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    assertThat(servlet.getMultipartResolver()).isNotNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
    verifyServletWorks();
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartUndertowConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartUndertow.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    verifyServletWorks();
    assertThat(servlet.getMultipartResolver()).isNotNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartTomcatConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartTomcat.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    assertThat(servlet.getMultipartResolver()).isNull();
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class))
            .hasSize(1);
    assertThat(this.context.getBeansOfType(MultipartResolver.class)).hasSize(1);
    verifyServletWorks();
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartJettyConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingJetty.class, BaseConfiguration.class);
    this.context.getBean(MultipartConfigElement.class);
    assertThat(this.context.getBean(StandardServletMultipartResolver.class)).isSameAs(
            this.context.getBean(DispatcherServlet.class).getMultipartResolver());
    verifyServletWorks();
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartTomcatConfiguration() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingTomcat.class, BaseConfiguration.class);
    new RestTemplate().getForObject("http://localhost:"
            + this.context.getEmbeddedServletContainer().getPort() + "/",
            String.class);
    this.context.getBean(MultipartConfigElement.class);
    assertThat(this.context.getBean(StandardServletMultipartResolver.class)).isSameAs(
            this.context.getBean(DispatcherServlet.class).getMultipartResolver());
    verifyServletWorks();
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartUndertowConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingUndertow.class, BaseConfiguration.class);
    this.context.getBean(MultipartConfigElement.class);
    verifyServletWorks();
    assertThat(this.context.getBean(StandardServletMultipartResolver.class)).isSameAs(
            this.context.getBean(DispatcherServlet.class).getMultipartResolver());
}
项目:spring-boot-concourse    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithCustomMultipartResolver() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithCustomMultipartResolver.class, BaseConfiguration.class);
    MultipartResolver multipartResolver = this.context
            .getBean(MultipartResolver.class);
    assertThat(multipartResolver)
            .isNotInstanceOf(StandardServletMultipartResolver.class);
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNothing() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNothing.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    verify404();
    assertNotNull(servlet.getMultipartResolver());
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class)
            .size(), equalTo(1));
    assertThat(this.context.getBeansOfType(MultipartResolver.class).size(),
            equalTo(1));
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartJettyConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartJetty.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    assertNotNull(servlet.getMultipartResolver());
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class)
            .size(), equalTo(1));
    assertThat(this.context.getBeansOfType(MultipartResolver.class).size(),
            equalTo(1));
    verifyServletWorks();
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartUndertowConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartUndertow.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    verifyServletWorks();
    assertNotNull(servlet.getMultipartResolver());
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class)
            .size(), equalTo(1));
    assertThat(this.context.getBeansOfType(MultipartResolver.class).size(),
            equalTo(1));
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithNoMultipartTomcatConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithNoMultipartTomcat.class, BaseConfiguration.class);
    DispatcherServlet servlet = this.context.getBean(DispatcherServlet.class);
    assertNull(servlet.getMultipartResolver());
    assertThat(this.context.getBeansOfType(StandardServletMultipartResolver.class)
            .size(), equalTo(1));
    assertThat(this.context.getBeansOfType(MultipartResolver.class).size(),
            equalTo(1));
    verifyServletWorks();
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartJettyConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingJetty.class, BaseConfiguration.class);
    this.context.getBean(MultipartConfigElement.class);
    assertSame(this.context.getBean(DispatcherServlet.class).getMultipartResolver(),
            this.context.getBean(StandardServletMultipartResolver.class));
    verifyServletWorks();
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartTomcatConfiguration() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingTomcat.class, BaseConfiguration.class);
    new RestTemplate().getForObject("http://localhost:"
            + this.context.getEmbeddedServletContainer().getPort() + "/",
            String.class);
    this.context.getBean(MultipartConfigElement.class);
    assertSame(this.context.getBean(DispatcherServlet.class).getMultipartResolver(),
            this.context.getBean(StandardServletMultipartResolver.class));
    verifyServletWorks();
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithAutomatedMultipartUndertowConfiguration() {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithEverythingUndertow.class, BaseConfiguration.class);
    this.context.getBean(MultipartConfigElement.class);
    verifyServletWorks();
    assertSame(this.context.getBean(DispatcherServlet.class).getMultipartResolver(),
            this.context.getBean(StandardServletMultipartResolver.class));
}
项目:contestparser    文件:MultipartAutoConfigurationTests.java   
@Test
public void containerWithCustomMultipartResolver() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext(
            ContainerWithCustomMultipartResolver.class, BaseConfiguration.class);
    MultipartResolver multipartResolver = this.context
            .getBean(MultipartResolver.class);
    assertThat(multipartResolver,
            not(instanceOf(StandardServletMultipartResolver.class)));
}
项目:training-sample    文件:WebAppConfig.java   
@Bean
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:ait-platform    文件:AitZuulServer.java   
@Bean(name = "commonsMultipartResolver")
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:reporting-tool    文件:WebAppConfig.java   
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:oma-riista-web    文件:WebMVCConfig.java   
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:ismartonline    文件:AppWebConfiguration.java   
@Bean()
public MultipartResolver multipartResolver(){
 return new StandardServletMultipartResolver();
}
项目:pswot-cloud-java-spring-webapp    文件:AppWebConfiguration.java   
@Bean
public MultipartResolver multipartResolver() { // Trarar requisições com arquivos em anexo
    return new StandardServletMultipartResolver();
}
项目:spring4-understanding    文件:RequestPartIntegrationTests.java   
@Bean
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MultipartAutoConfiguration.java   
@Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME)
@ConditionalOnMissingBean(MultipartResolver.class)
public StandardServletMultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:java-platform    文件:WebConfiguration.java   
@Bean
public MultipartResolver multipartResolver() {
    StandardServletMultipartResolver resolver = new StandardServletMultipartResolver();
    resolver.setResolveLazily(true);
    return resolver;
}
项目:spring-boot-concourse    文件:MultipartAutoConfiguration.java   
@Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME)
@ConditionalOnMissingBean(MultipartResolver.class)
public StandardServletMultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:ExcelToBarcode    文件:WebConfiguration.java   
@Bean 
public MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:contestparser    文件:MultipartAutoConfiguration.java   
@Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME)
@ConditionalOnMissingBean(MultipartResolver.class)
public StandardServletMultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:cross-preferences    文件:Config.java   
@Bean
MultipartResolver multipartResolver() {
    return new StandardServletMultipartResolver();
}
项目:EasyEE    文件:MvcConfiguration.java   
@Bean
public StandardServletMultipartResolver multipartResolver() {
    StandardServletMultipartResolver ssmr = new StandardServletMultipartResolver();
    return ssmr;
}
项目:EasyEE    文件:MvcConfiguration.java   
@Bean
public StandardServletMultipartResolver multipartResolver() {
    StandardServletMultipartResolver ssmr = new StandardServletMultipartResolver();
    return ssmr;
}