In a Struts 2 application using v22.214.171.124, the file upload from a JSP page with "multipart/form-data" does not work anymore on Weblogic v12c which supports Java Servlet specification v3.0. The same application worked on v10.3.2 which supports Java Servlet specification v2.4:
* The "method" attribute in the <s:submit> tag is ignored. Struts always invokes the execute() method of the Struts action.
* If you use the execute() method for the upload (with the according changes in the action and JSP page), none of the parameters (data, dataContentType, dataFileName, contentTx) are transferred to the Struts action
* The same code does not work with the older Struts v2.1.8 on Weblogic v12c
Please find the setup below.
Is this is a bug? Or is something wrong with my setup?
With the introduction of the Servlet 3.0 multipart file handling (@MultipartConfig) there was a change in WLS to the way in which multipart/form-data uploads are being handled. It appears this has caused some problems with frameworks such as Struts that have their own upload capability based on direct access to mutlipart/form-data in a non Servlet 3.0 manner.
We have a bug logged and are currently investigating it.
The fix is not yet available, but if you need a patch, you could open a support request, reference bug#13657792 and ask to be notified when it is done.
On March 15th, we updated the WLS 12c distribution on OTN to enable support for Java 7 on production systems. As part of that update we also took the opportunity to include a number of bundled patches for several high priority issues -- the fix for the Servlet 3.0 file upload bug was included as one of those patches.
I'd suggest the easiest way to resolve this is to download the latest WLS 12c distribution (only use wls1211_generic.jar or wls1211_dev.zip, the OEPE bundles are still in the process of being updated) and use that.
In general for a bug fix/patch you need to go through Oracle Support -- http://support.oracle.com.
I just tested the WLS 12c updated distribution, which automatically includes the patch for bug # 13657792, with the Struts 2.3.3 show case application and verified the file upload example works as expected.