Improve docs on enabling Servlet 3 multipart

This commit is contained in:
Rossen Stoyanchev
2018-03-19 11:20:08 -04:00
parent 8651b8d4c1
commit 26bb3a0893
2 changed files with 34 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,6 +41,18 @@ import org.springframework.web.multipart.MultipartResolver;
* storage locations need to be applied at that servlet registration level;
* Servlet 3.0 does not allow for them to be set at the MultipartResolver level.
*
* <pre class="code">
* public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
* // ...
* &#064;Override
* protected void customizeRegistration(ServletRegistration.Dynamic registration) {
*
* // Optionally also set maxFileSize, maxRequestSize, fileSizeThreshold
* registration.setMultipartConfig(new MultipartConfigElement("/tmp"));
* }
* }
* </pre>
*
* @author Juergen Hoeller
* @since 3.1
* @see #setResolveLazily