As for a workaround, the best I got before I found that upgrading Mozilla fixed my problem, was to do client-side validation with JavaScript. In the end though this only ensured the user did specify a value for the file to upload. It did not ensure the file was valid, which BTW if the file is not valid you will get the same error :(
If I had to write a more elegant workaround, I would look specifically for this error condition in an exception handler and return a more sophisticated error to the user if the did not enter a file or entered an invalid file (e.g. file does not exist in path specified).
Good luck, let me know how it turns out!
-Joey
Cynthia Jeness wrote:
Since I am running Mozilla 0.99, this may be the cause of the problem;
however, we have little control over what browsers our customers choose to
run. If Mozilla does not send back a file name, then that piece of
information can be missing from my error message to the client. However,
the error itself needs to be handled more gracefully. It would be daunting
to the normal user to be presented with an invalid argument exception on
"bean populate" and a stack trace. I have tried to understand where the
error occurs. It seems to me that when Mozilla cannot process the filename
that the user has entered, the file name is sent back as part of the
request parameter stream and the commons "populate" routine is handling it
like a string. It fails because it cannot find a write method for the
parameter which accepts a String. I have tried providing a setter which
accepts an Object; however, then the file transfer does not occur when a
proper file name is supplied. I have also tried two different setters --
one with a String and one with the FormFile. This also does not work.
So, in short, are there any suggestions for a workaround or plans to handle
the error situation more gracefully in Struts or the "commons-beanutils"
routines?
Of course, if Mozilla 0.99 is the only browser that has this problem and
Netscape 4.6+ or IE work correctly along with later versions of Mozilla,
then a workaround may not be as necessary.
Cynthia Jeness
Joey Ebright wrote:
I found that my problem stemmed from a bug in Mozilla 0.99. Once I
upgraded my Mozilla browser to version 1.2.1 the problem went away. You
can find details on this bug here:
http://bugzilla.mozilla.org/show_bug.cgi?id=132069
Thanks for all who offered feedback!!!
Joey Ebright wrote:
I too have the same problem - whenever the user does not supply a file---------------------------------------------------------------------
to upload I get an exception. I have tried the 1.1-b3 release of
struts and the 1.6 release of the commons and recieve the same error
from BeanUtils.populate - IllegalArgumentException...
Have you made any progress on this front?
-Joey
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

