Forwarding an experience report on the new commons-fileupload code --
Erich is having problems with the mailing list.

Martin, you'll undoubtedly want to take a look at this.

Craig


---------- Forwarded message ----------
Date: Wed, 31 Jul 2002 00:19:12 +0200
From: Erich Meier <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Incompatibilities with new fileupload package in nightly build
    (fwd)

Hi Craig,

sorry for sending this one directly to you, but I have been desperately
trying to send this mail onto struts-user and struts-dev (a day later).
The emails never surfaced there. Other emails went through without problems.
Obviously, the list processor also does not like file upload. ;-)

I feel, that this problem is important enough for solving it in a later 1.1b.

Could you please forward it into the right direction?

Thanks in advance,
Erich
-- 
Dr. Erich Meier, Software Process Improvement
method park Software AG, Wetterkreuz 19a, 91058 Erlangen, Germany
phone: +49-9131-97206-316  mailto:[EMAIL PROTECTED]
fax:   +49-9131-97206-200  http://www.methodpark.de/
--- Begin Message ---
Hi!

I tried the new fileuploader from the commons package and ran into two
incompatibilities. The first one is a small semantic change, the second one
seems to be a bug.

Before ranting about errors and shortcomings, let me say that the new
fileuploader seems to be much more speedy than the old one. I didn't measure
it, though.

Now for the problems I found...

First, the new fileuploader returns the whole file path in getFileName().
It uses the client's representation, i.e. "C:\Program File\bla\foo\a.jpg".
The old one only returned the file name ("a.jpg") which seems to be the
better alternative. If you want to store the file name of uploaded content
to send it back to the client via the Content-Disposition header, the file
name would suffice. With the new semantics, I'd have to stuff the path name into
a File object to retrieve the file name in a platform independent manner.
This seems clumsy for me. YMMV.

Second, if I submit an upload page without content being uploaded (user did
not select a file), an exception occurs:

javax.servlet.ServletException: BeanUtils.populate
        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:974)
        at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:779)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:246)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

root cause 

java.lang.IllegalArgumentException: java.lang.ClassCastException@7e942f
        at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at 
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1650)
        at 
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1545)
        at 
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1574)
        at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:919)
        at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726)
        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:972)
        at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:779)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:246)

Hope this helps weeding out the bugs out of the new fileupload package.

Erich

-- 
Dr. Erich Meier, Software Process Improvement
method park Software AG, Wetterkreuz 19a, 91058 Erlangen, Germany
Tel. +49-9131-97206-316  mailto:[EMAIL PROTECTED]
Fax. +49-9131-97206-200  http://www.methodpark.de/

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--- End Message ---
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to