Skip to content

Servlet 3 multipart parameter binding does not work on Weblogic12c (12.1.2.0) [SPR-11074] #15700

@spring-projects-issues

Description

@spring-projects-issues

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:

Backported to: 3.2.9

0 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions