|
I think that specific line in ArgumentsResolver should be ExtendedModelMap.class.isAssignableFrom(param.getParameterType()).
I guess because of erasure you cannot get the type of a generic method parameter. Shame. Good news: We actually can resolve generic type variables as long as they are statically declared in subclasses (like in your case)! I've added full support for such generic types in handler method signatures, to be released in Spring 2.5.2.
I've taken this occasion to do some general refactoring of the AnnotationMethodHandlerAdapter classes. The Servlet and Portlet variants share their common code as far as feasible now, in particular with respect to method argument resolution. This revision will be available in the next 2.5.2 snapshot (-374 or higher; available from http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR). Please give it a try and let us know whether it works for you... Thanks for raising this! Juergen Sorry but it doesn't work in the nightly build 20080117-374. Since my generic parameter is Serializable I still get a ExtendedModelMap instead of an Integer. If I change in ArgumentsResolver.resolveArguments() to ExtendedModelMap.class.isAssignableFrom(param.getParameterType() I get an array of Strings because of paramValue = request.getParameterValues(paramName). I expect an Integer...
Unfortunately this revision hasn't made it into CVS yet due to SourceForge problems... SourceForge's developer CVS has been down for nearly two days. As a consequence, build 374 still contains the "old" code. I'll let you know when the changes are actually in the nightly build!
Sorry for the incovenience... Juergen Works fine in the latest build. Great job!
|
||||||||||||||||||||||||||||||||||||||||||||||||||
In my case the parameter is a Serializable. Since ExtendedModelMap is also a Serializable this returns true. I will comment again I made a fix.