|
From: Trevor C. <pr...@se...> - 2003-09-27 17:36:38
|
First some history: http://sourceforge.net/mailarchive/message.php?msg_id=3891279 http://sourceforge.net/mailarchive/message.php?msg_id=5175276 http://sourceforge.net/mailarchive/forum.php?thread_id=3125561&forum_id=3028 7 http://sourceforge.net/mailarchive/message.php?msg_id=6062288 To address a few things Juergen mentioned previously. >> a less intrusive way would be to wrap the HttpServletRequest via a filter I personally don't like the filter approach, at least for the framework. It requires additional setup for the user (in the web.xml file) and might be less understandable since our normal strategy so far has been with resolvers inside the servlet. >>we would need to find concrete requirements for this We have numerous uses for file upload handling. We have a public photo contest where users can upload fotos. We have special access for suppliers to upload product files (csv) which we then add in to our ordering system. Finally, we have a web administration interface which allows our client to upload files to the website so they can be downloaded. I think that including this support (multipart handling) is a no-brainer. Basically, I have used COS exclusively in our projects, but I don't think that's easy for Spring to use (due to the licensing). I would simply code this according to Spring norms using an interface and a default version using Commons FileUpload. Later, if somebody wants to create a cos version we can (but to be honest, if we have a working, integrated solution I'm not sure that is necessary - at least not in the Spring framework). Basically, provide hooks and a default implementation, and allow users to adopt as necessary. In our project we had modified the AbstractController and put the code into it to handle the multipart processing, returning a wrapped HttpServletRequest through the handlers. This is very similiar to Juergen's outline (http://sourceforge.net/mailarchive/message.php?msg_id=3891279). Since we are migrating to the current Spring codebase, I need to move our multipart handling code. The main question is whether we keep it internally, or place it into Spring. I propose modifying org.springframework.web.servlet.DispatcherServlet to have a "MultipartResolver". In the DispatcherServlet, the resolver would be called to wrap the request in doService immediately before getHandler(request) - currently line 351, and then called to do any cleanup immediately before exiting the doService method. I have about 2/3 of the code already written, and I will be writing the rest between now and Monday. Does this strategy sound appropriate for Spring (meaning should I commit it to the Spring codebase) when it's finished? Trevor D. Cook Interprise Software |