cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Howard" <>
Subject upload problem (WAS: RE: How to use the file uploading mechanism in cocoon)
Date Fri, 16 May 2003 03:45:07 GMT
> -----Original Message-----
> From: Stefano Mazzocchi []
> Sent: Friday, April 04, 2003 10:14 AM
> To: Apache Cocoon
> Subject: How to use the file uploading mechanism in cocoon


> alternatively, you can write the following java code in your sitemap 
> components
>   import org.apache.cocoon.servlet.multipart.*;
>   ...
>   Request request = ObjectModelHelper.getRequest(obj);
>   if (request instanceof MultipartHttpServletRequest) {

This will not work, will it?  The ObjectModelHelper will return 
o.a.c.environment.HttpRequest (implements o.a.c.environment.Request) 
and therefore this test will always be false, even when the private 
HttpServletRequest held by o.a.c.environment.HttpRequest is in fact 
a multipart.  The instanceof test works in because 
it's testing its private member, not itself. 

This makes the cleanup fail on CocoonServlet:1209.

What about exposing something like boolean isMultiPart()?  Also, I've 
wanted to have the multipart request keep a list of the keys that contain 
Parts so that cleanup() doesn't have to Enumerate all request params.  
There would be other uses for both of these.  Are these contracts that can 


View raw message