Lars Trieloff skrev:
Hi Daniel,

I've just noted that uploads with CForms are not working with the Blocks Framework. The reason is a bug in org.apache.cocoon.environment.http.HttpRequest.get() that checks for a wrapped MultipartHttpServletRequest.

Checking for a class doesn't seem to be a good idea I think we should check for an interface instead.

With the Blocks framework the actual MultipartHttpServletRequest is wrapped into an anonymous HttpServletRequestWrapper in DispatcherServlet.

My proposal to fix the bug without including cyclic dependencies is to create a new abstract class org.apache.cocoon.AbstractValueHttpServletRequestWrapper that includes a get-method, extends HttpRequestWraper and will be extended by MultipartHttpServletRequestWrapper as well as by the anonymous class in DispatcherServlet. The HttpRequest would check for this class and uploads are working again.

What do you think?

Using the MultipartFilter is optional so I don't think that the blocks fw should assume that it is used and that we have a MultipartHttpServletRequest as request.

Maybe we instead could make the DispatcherServlet less intrusive on the request object by modifying the getServletPath() and getPathInfo() on the incomming request object by a dynamic proxy instead of wrapping it with a request wrapper.

WDYT?

/Daniel

Reply via email to