-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Kazuki Shimizu opened SPR-11074 and commented
[Execution Conditions]
- Weblogic Server 12c(12.1.2.0)
- Using Upload functionality of Servlet 3 specification
- Form data(upload file & other item) is bound to form object(form backing bean).
[Execution Result]
Upload file(MultipartFile) is bound to Form object, but other item is not bound to Form object.
h4.[Example code(overview)]
[jsp]
<form:form action="${pageContext.request.contextPath}/upload/flow"
method="post"
enctype="multipart/form-data"
modelAttribute="fileUploadForm">
<form:input type="file" path="file" />
<form:input path="description" />
<form:button name="confirmAndUpload">Confirm</form:button>
</form:form>
[web.xml]
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:META-INF/spring/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<multipart-config>
</multipart-config>
</servlet>
[weblogic.xml]
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
[spring-mvc.xml]
<bean id="multipartResolver"
class="org.springframework.web.multipart.support.StandardServletMultipartResolver" />
[Form object]
public class FileUploadForm implements Serializable {
private MultipartFile file;
private String description;
// omitted
}
[Controller]
@RequestMapping(method = RequestMethod.POST, params = "confirmAndUpload")
public String confirmAndUpload(FileUploadForm form) {
// omitted
}
h4.[Detail example code]
Please see following page.
[jsp]
[controller]
h4.Other information
- Tomcat7 & Resin4.0 is succeed by the same source code.
Affects: 3.2.4
Issue Links:
- StandardServletMultipartResolver should support lazy resolution along the lines of CommonsMultipartResolver [SPR-11730] #16352 StandardServletMultipartResolver should support lazy resolution along the lines of CommonsMultipartResolver
Backported to: 3.2.9
0 votes, 5 watchers
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug