Add MultipartAutoConfigure to spring.factories
Update META-INF/spring.factories to include MultipartAutoConfigure. Also tweaked the class @Conditionals and Javadoc. Issue: BS-157
This commit is contained in:
parent
665d07ad74
commit
db05637e06
|
|
@ -17,25 +17,30 @@
|
||||||
package org.springframework.bootstrap.autoconfigure.web;
|
package org.springframework.bootstrap.autoconfigure.web;
|
||||||
|
|
||||||
import javax.servlet.MultipartConfigElement;
|
import javax.servlet.MultipartConfigElement;
|
||||||
|
import javax.servlet.Servlet;
|
||||||
|
|
||||||
import org.springframework.bootstrap.context.annotation.ConditionalOnBean;
|
import org.springframework.bootstrap.context.annotation.ConditionalOnBean;
|
||||||
|
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||||
|
import org.springframework.bootstrap.context.embedded.EmbeddedWebApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
|
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} for multi-part uploads. It detects
|
* {@link EnableAutoConfiguration Auto-configuration} for multi-part uploads. Adds a
|
||||||
* the existence of a {@link MultipartConfigElement} in the app context and then adds
|
* {@link StandardServletMultipartResolver} when a {@link MultipartConfigElement} bean is
|
||||||
* critical beans while also autowiring it into the Jetty/Tomcat embedded containers.
|
* defined. The {@link EmbeddedWebApplicationContext} will associated the
|
||||||
|
* {@link MultipartConfigElement} bean to any {@link Servlet} beans.
|
||||||
*
|
*
|
||||||
* @author Greg Turnquist
|
* @author Greg Turnquist
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@ConditionalOnClass({ Servlet.class, StandardServletMultipartResolver.class })
|
||||||
|
@ConditionalOnBean(MultipartConfigElement.class)
|
||||||
public class MultipartAutoConfiguration {
|
public class MultipartAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnBean(MultipartConfigElement.class)
|
|
||||||
public StandardServletMultipartResolver multipartResolver() {
|
public StandardServletMultipartResolver multipartResolver() {
|
||||||
return new StandardServletMultipartResolver();
|
return new StandardServletMultipartResolver();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ org.springframework.bootstrap.autoconfigure.orm.jpa.HibernateJpaAutoConfiguratio
|
||||||
org.springframework.bootstrap.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\
|
org.springframework.bootstrap.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\
|
||||||
org.springframework.bootstrap.autoconfigure.web.EmbeddedServletContainerAutoConfiguration,\
|
org.springframework.bootstrap.autoconfigure.web.EmbeddedServletContainerAutoConfiguration,\
|
||||||
org.springframework.bootstrap.autoconfigure.web.ServerPropertiesAutoConfiguration,\
|
org.springframework.bootstrap.autoconfigure.web.ServerPropertiesAutoConfiguration,\
|
||||||
|
org.springframework.bootstrap.autoconfigure.web.MultipartAutoConfiguration,\
|
||||||
org.springframework.bootstrap.autoconfigure.web.WebMvcAutoConfiguration
|
org.springframework.bootstrap.autoconfigure.web.WebMvcAutoConfiguration
|
||||||
|
|
||||||
# Application Context Initializers
|
# Application Context Initializers
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue