@AutoConfiguration @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 |
---|---|
MultipartConfigElement |
multipartConfigElement() |
StandardServletMultipartResolver |
multipartResolver() |
public MultipartAutoConfiguration(MultipartProperties multipartProperties)
@Bean @ConditionalOnMissingBean(value={javax.servlet.MultipartConfigElement.class,org.springframework.web.multipart.commons.CommonsMultipartResolver.class}) public MultipartConfigElement multipartConfigElement()
@Bean(name="multipartResolver") @ConditionalOnMissingBean(value=org.springframework.web.multipart.MultipartResolver.class) public StandardServletMultipartResolver multipartResolver()