Hello All
Any ideas on this one? I switched to a manual validation, which works,
though I'd much rather use the built-in mechanism to validate where
possible.
thanks
Collin
Collin VanDyck wrote:
Hello!
I'm using struts-1.2.7.
I have form that needs both file upload functionality as well as normal
form fields interspersed on the same HTML page. I'm using the built-in
struts file upload utilities, so I create the form:
<html:form method="POST" action="/entity/submitfile.act"
enctype="multipart/form-data">
...
</html:form>
If there are no errors, this approach works perfectly. I correctly
receive the file data submitted, if any, along with the normal form
field values.
However, if my ActionForm fails validation, when the resultant action
gets called (specified by the input attribute) the request object
contains no request data from my form. My ActionForm, however,
populates correctly.
I understand that for multipart/form-data encoding types that the
framework will wrap the normal request object in a
MultipartRequestWrapper. Indeed, this is the case when this form
submits. The MultipartRequestWrapper does not contain any of my request
parameters from the form. I called MultipartRequestWrapper.getRequest()
to get the original request that was wrapped to begin with, but it also
does not have any of my request parameters.
The strange thing is, is that if I convert the form to not be
multipart/form-data encoded, and remove the file upload widget, it works
perfectly, retaining request parameters even when validation fails.
Any ideas on what I may be doing wrong? I feel like this is probably a
common problem. I found some similar problems on the mailing list
archives, but could not find any resolutions.
many thanks
Collin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]