SUPPORT-8438
This commit is contained in:
parent
f07e6a2310
commit
70e55f8da0
1 changed files with 13 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import javax.servlet.ServletContext;
|
|||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRegistration;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
|
||||
import org.springframework.web.util.IntrospectorCleanupListener;
|
||||
|
||||
|
|
@ -12,6 +13,13 @@ import org.springframework.web.util.IntrospectorCleanupListener;
|
|||
*/
|
||||
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
|
||||
|
||||
@Value("${file.config.max_file_size}")
|
||||
private int maxFileSize;
|
||||
@Value("${file.config.max_request_size}")
|
||||
private int maxRequestSize;
|
||||
@Value("${file.config.file_size_threshold}")
|
||||
private int fileSizeThreshold;
|
||||
|
||||
public void onStartup(ServletContext servletContext) throws ServletException {
|
||||
super.onStartup(servletContext);
|
||||
servletContext.addListener(new IntrospectorCleanupListener());
|
||||
|
|
@ -33,7 +41,11 @@ public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServlet
|
|||
|
||||
@Override
|
||||
protected void customizeRegistration(ServletRegistration.Dynamic registration) {
|
||||
MultipartConfigElement multipartConfigElement = new MultipartConfigElement("/tmp");
|
||||
MultipartConfigElement multipartConfigElement = new MultipartConfigElement(
|
||||
"/tmp",
|
||||
maxFileSize,
|
||||
maxRequestSize,
|
||||
fileSizeThreshold);
|
||||
registration.setMultipartConfig(multipartConfigElement);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue