@Configuration @ConditionalOnClass(value={javax.servlet.Servlet.class,org.springframework.web.multipart.support.StandardServletMultipartResolver.class,javax.servlet.MultipartConfigElement.class}) @ConditionalOnProperty(prefix="spring.servlet.multipart", name="enabled", matchIfMissing=true) @ConditionalOnWebApplication(type=SERVLET) @EnableConfigurationProperties(value=MultipartProperties.class) public class MultipartAutoConfiguration extends Object
Auto-configuration
for multi-part uploads. Adds a
StandardServletMultipartResolver
if none is present, and adds a
multipartConfigElement
if none is
otherwise defined. The ServletWebServerApplicationContext
will associate the
MultipartConfigElement
bean to any Servlet
beans.
The MultipartConfigElement
is a Servlet API that's used to
configure how the server handles file uploads.
Constructor and Description |
---|
MultipartAutoConfiguration(MultipartProperties multipartProperties) |
Modifier and Type | Method and Description |
---|---|
javax.servlet.MultipartConfigElement |
multipartConfigElement() |
org.springframework.web.multipart.support.StandardServletMultipartResolver |
multipartResolver() |
public MultipartAutoConfiguration(MultipartProperties multipartProperties)
@Bean @ConditionalOnMissingBean(value={javax.servlet.MultipartConfigElement.class,org.springframework.web.multipart.commons.CommonsMultipartResolver.class}) public javax.servlet.MultipartConfigElement multipartConfigElement()
@Bean(name="multipartResolver") @ConditionalOnMissingBean(value=org.springframework.web.multipart.MultipartResolver.class) public org.springframework.web.multipart.support.StandardServletMultipartResolver multipartResolver()
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.