Class MultipartResolverConfiguration
java.lang.Object
com.foreach.across.modules.web.config.multipart.MultipartResolverConfiguration
@Order(-2147483647)
@Configuration
@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)
@EnableConfigurationProperties(org.springframework.boot.autoconfigure.web.servlet.MultipartProperties.class)
public class MultipartResolverConfiguration
extends Object
Creates a MultipartResolver for handling multipart requests. Will use the
MultipartFilter
if possible and fallback
to multipart resolving in the DispatcherServlet
.
If Commons FileUpload is not present on the classpath, the standard servlet resolver will be used. This requires the web container to support multipart resolving.
- See Also:
-
StandardServletMultipartResolver
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMultipartResolverConfiguration
(org.springframework.boot.autoconfigure.web.servlet.MultipartProperties multipartProperties, AcrossListableBeanFactory beanFactory) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.multipart.MultipartResolver
filterMultipartResolver
(jakarta.servlet.MultipartConfigElement multipartConfigElement, jakarta.servlet.ServletContext servletContext) jakarta.servlet.MultipartConfigElement
multipartConfigElement
(String tempDirectory) org.springframework.boot.web.servlet.FilterRegistrationBean
multipartFilterRegistration
(jakarta.servlet.ServletContext servletContext, jakarta.servlet.MultipartConfigElement multipartConfigElement, org.springframework.web.multipart.MultipartResolver multipartResolver) void
registerMultipartConfig
(org.springframework.beans.factory.ListableBeanFactory beanFactory)
-
Field Details
-
FILTER_NAME
- See Also:
-
COMMONS_FILE_UPLOAD
- See Also:
-
-
Constructor Details
-
MultipartResolverConfiguration
public MultipartResolverConfiguration(org.springframework.boot.autoconfigure.web.servlet.MultipartProperties multipartProperties, AcrossListableBeanFactory beanFactory)
-
-
Method Details
-
multipartConfigElement
@Bean @ConditionalOnMissingBean public jakarta.servlet.MultipartConfigElement multipartConfigElement(@Value("${java.io.tmpdir}") String tempDirectory) -
filterMultipartResolver
@Bean @ConditionalOnMissingBean public org.springframework.web.multipart.MultipartResolver filterMultipartResolver(jakarta.servlet.MultipartConfigElement multipartConfigElement, jakarta.servlet.ServletContext servletContext) -
registerMultipartConfig
@Autowired public void registerMultipartConfig(org.springframework.beans.factory.ListableBeanFactory beanFactory) -
multipartFilterRegistration
@Bean @ConditionalOnConfigurableServletContext @ConditionalOnBean(name="filterMultipartResolver") public org.springframework.boot.web.servlet.FilterRegistrationBean multipartFilterRegistration(jakarta.servlet.ServletContext servletContext, jakarta.servlet.MultipartConfigElement multipartConfigElement, @Qualifier("filterMultipartResolver") org.springframework.web.multipart.MultipartResolver multipartResolver)
-