<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=harish" rel="nofollow">harish</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9311?redirect=false" rel="nofollow">SPR-9311</a></strong> and commented</p>
<p dir="auto">Currently Resttemplate uses an enum of 'standard' HTTP status codes, that is subset of all legally possible HTTP status codes that services can return. When a non standard HTTP status code is returned by services, an IllegalArgumentException is thrown and all response body is ignored. We call services that use custom code 450 for user validation errors along with an xml containing list of messages codes and message text. Unfortunately we get only an illegal argument exception and response body is lost. I think it would be helpful if say all 4xx, 1xx, 2xx, 5xx are treated as legal responses and their response bodies are preserved and passed to the caller. At the least a hook could be provided to extend the enum used by Resttemplate to add additional HTTP codes that caller might expect.</p>
<hr>
<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="398102304" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11418" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11418/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11418">#11418</a> RestTemplate throws IllegalArgumentException when HTTP status is not in the HttpStatus enum  (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">2 votes, 3 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ps466" rel="nofollow">Paul Sideleau</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7795?redirect=false" rel="nofollow">SPR-7795</a></strong> and commented</p>
<p dir="auto">I have setup a MultipartFilter and HtmlHiddenMethodFilter following the instructions in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398101171" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11260" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11260/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11260">#11260</a> and the javadoc.</p>
<p dir="auto">I have a java bean that has a org.springframework.web.multipart.MultipartFile property. I attempt to bind my bean with the standard <code class="notranslate">@ModelAttribute</code> annotation. The rest of its properties get resolved correctly but the MultipartFile property is set to null.</p>
<p dir="auto">I believe the issue is that on line 106 of the ServletRequestDataBinder it does an instanceof check: "request instanceof MultipartRequest" which will return false because its the HttpMethodRequestWrapper class from the HtmlHiddenMethodFilter.</p>
<p dir="auto">However, if I move the property out of my javabean and bind it via a RequestParam annoation, it works correctly.</p>
<p dir="auto">public ModelAndView uploadFile(<code class="notranslate">@RequestParam</code>("file") MultipartFile file) {<br>
// code<br>
}</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.4</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="398110693" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12695" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12695/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12695">#12695</a> ServletRequestDataBinder.bind should also consider wrapped ServletRequests when checking for Multipart,  to comply with HiddenHttpMethodFilter. (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398101171" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11260" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11260/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11260">#11260</a> HiddenHttpMethodFilter does not support multipart requests</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/b3f039ae5f0b54a325cdb23f6720e5002b054cee/hovercard" href="https://github.com/spring-projects/spring-framework/commit/b3f039ae5f0b54a325cdb23f6720e5002b054cee"><tt>b3f039a</tt></a></p>
<p dir="auto">1 votes, 2 watchers</p>