You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/01/25 09:59:37 UTC
DO NOT REPLY [Bug 26336] -
Empty multipart form from Opera browser results in ServletException
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26336>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26336
Empty multipart form from Opera browser results in ServletException
------- Additional Comments From martinc@apache.org 2004-01-25 08:59 -------
Ugh. Not sure how to fix this one.
IE is sending a Content-Type header for the file input field, which is causing
us to recognise the field as a file upload field. Opera is not sending this
header, so the field is indistinguishable from a regular text field. Thus,
BeanUtils is attempting to populate the field with an empty string, just as it
would do with a regular text field. Since the form bean item is a FileItem and
not a string, BeanUtils throws the exception you are seeing.
It's possible that we could determine that this has happened by being more
specific in our handling of BeanUtils exceptions. However, that would leave the
form bean partially populated, with no way to go back and finish up after the
file item has caused the exception. So that doesn't really fly.
The other alternative I can think of is to scan the form bean for file items
before calling BeanUtils, and removing and such field names from the map that
BeanUtils will use to populate the form. While this would probably work, it
would impose a horrible performance hit on every use of a form bean, just to
determine whether or not there are any file items present.
Any other ideas would be very welcome.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org