<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=stefanoc" rel="nofollow">Stefan Ocke</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8040?redirect=false" rel="nofollow">SPR-8040</a></strong> and commented</p>
<p dir="auto">When using HiddenHttpMethodFilter, like for example Spring Roo generated apps do, the ServletRequest is wrappd into a HttpMethodRequestWrapper (at least in cases, where wrapping is necessary, for example for PUT requests emulated with POST and httpMethod parameter).</p>
<p dir="auto">Later, when it comes to data binding the ServletRequestDataBinder.bind method checks for multipart requests:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MutablePropertyValues mpvs = new ServletRequestParameterPropertyValues(request);
		if (request instanceof MultipartRequest) {
			MultipartRequest multipartRequest = (MultipartRequest) request;
			bindMultipart(multipartRequest.getMultiFileMap(), mpvs);
		}
		doBind(mpvs);"><pre class="notranslate"><code class="notranslate">MutablePropertyValues mpvs = new ServletRequestParameterPropertyValues(request);
		if (request instanceof MultipartRequest) {
			MultipartRequest multipartRequest = (MultipartRequest) request;
			bindMultipart(multipartRequest.getMultiFileMap(), mpvs);
		}
		doBind(mpvs);
</code></pre></div>
<p dir="auto">But if the multipart request has been wrapped into a HttpMethodRequestWrapper , this won't work anymore, since it is not an instance of MultipartRequest. Thus, no databinding for the Multipart files occurs.</p>
<p dir="auto">NOTE: My setup ist the following:</p>
<ul dir="auto">
<li>I am using a MultipartFilter in front of the WebMethodFilter, as suggested in bold letters in  the Javadoc of HiddenHttpMethodFilter</li>
<li>I am using binding for the uploaded files, instead of "injecting" them as parameters in the controller mehtods. For this, I register an according converter / bean editor from MultipartFile to byte array</li>
<li>For POST request, this setup works fine. For PUT (emulated by POST and httpMethod parameter), the problem described above arises.</li>
</ul>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109051" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12451" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12451/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12451">#12451</a> ServletRequestDataBinder does not bind MultipartFile with HiddenHttpMethodFilter and Multipart Request (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=gregorian21" rel="nofollow">Arun Reddy</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2171?redirect=false" rel="nofollow">SPR-2171</a></strong> and commented</p>
<p dir="auto">The form:form tag set the 'id' value to 'null' when not specified and does not take into consideration the value specified for the 'name' attribute.</p>
<p dir="auto">For example,</p>
<p dir="auto">i) No 'id' or 'name' attribute specified</p>
<p dir="auto">&lt;form:form action="actionUrl" method="post" commandName="commandObjectName"&gt; &lt;/form:form&gt;   results in</p>
<p dir="auto">&lt;form id="null" name="null" method="post" action="actionUrl"&gt;&lt;/form&gt;</p>
<p dir="auto">ii) 'name' attribute specified</p>
<p dir="auto">&lt;form:form name="formName" action="actionUrl" method="post" commandName="commandObjectName"&gt;&lt;/form:form&gt;   results in</p>
<p dir="auto">&lt;form id="null" name="null" method="post" name="formName" action="actionUrl"&gt;&lt;/form&gt;</p>
<p dir="auto">iii) 'id' and 'name' attribute is specified</p>
<p dir="auto">&lt;form:form id="formId" name="formName" action="actionUrl" method="post" commandName="commandObjectName"&gt;&lt;/form:form&gt;  results in</p>
<p dir="auto">&lt;form id="formId" name="null" method="post" name="formName" action="actionUrl"&gt;&lt;/form&gt;<br>
This behaviour is inconsistent with that in previous milestone releases.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 RC1</p>