Class MultipartAutoConfiguration
java.lang.Object
org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration
@AutoConfiguration
@ConditionalOnClass({jakarta.servlet.Servlet.class,org.springframework.web.multipart.support.StandardServletMultipartResolver.class,jakarta.servlet.MultipartConfigElement.class})
@ConditionalOnProperty(prefix="spring.servlet.multipart",
name="enabled",
matchIfMissing=true)
@ConditionalOnWebApplication(type=SERVLET)
@EnableConfigurationProperties(MultipartProperties.class)
public class MultipartAutoConfiguration
extends Object
Auto-configuration
for multipart 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.
- Since:
- 2.0.0
- Author:
- Greg Turnquist, Josh Long, Toshiaki Maki
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription
-
Constructor Details
-
MultipartAutoConfiguration
-
-
Method Details
-
multipartConfigElement
@Bean @ConditionalOnMissingBean(jakarta.servlet.MultipartConfigElement.class) public MultipartConfigElement multipartConfigElement() -
multipartResolver
@Bean(name="multipartResolver") @ConditionalOnMissingBean(org.springframework.web.multipart.MultipartResolver.class) public StandardServletMultipartResolver multipartResolver()
-