|
From: Trevor C. <pr...@se...> - 2003-10-13 20:23:00
|
<juergen> Furthermore, I've dropped the previous PropertyEditors support, and the = associated requirement for file parameters having to be available as = normal parameters with the field name as value. That seemed like a = workaround; instead, I've added explicit detection to = ServletRequestDataBinder, which is now able to bind file parameters as = MultipartFile or byte[], depending on the type of the target bean = property. I've not reintroduced binding the original file name to a = String property, as I can't see the value of that feature. </juergen> No problem dropping the String <> filename, I wasn't sure if that would = be useful or not. I do have a problem with dropping the PropertyEditors support, since in = my mind it removes flexibility and consistency. =20 Treating all the data (simple text fields or files) as parameters seems = to make a lot more sense to me since you can then treat every piece of = data the same (instead of having to handle parameters and files = seperately). If the implementation was a little clumsy I apologize, but = the concept was not a workaround but a goal to allow the user to be able = to treat all data in the same manner. The issue of flexibility is due to the "explicit detection to = ServletRequestDataBinder". In the previous implementation and the = current one, files were automatically bound to an object based on the = target properties type. The difference was that you could override it = with a custom property editor (in the BaseCommandController initBinder = method, for example). Under the current implementation, there is no way = to override how the file is attached to the bean. Do you (or anybody = else) have any suggestions on how to override the default Spring = handling (currently hard-coded in ServletRequestDataBinder), or any = ideas of how to change the implementation to allow this custom handling? = =20 Trevor D. Cook |