Issue Details (XML | Word | Printable)

Key: SPR-5191
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Juergen Hoeller
Reporter: Paul Middelkoop
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Framework

HandlerMethodResolver doesn't work with Bridged methods

Created: 01/Oct/08 09:49 AM   Updated: 02/Oct/08 09:41 AM   Resolved: 02/Oct/08 09:41 AM
Component/s: SpringWEB
Affects Version/s: 2.5.5
Fix Version/s: 2.5.6

Time Tracking:
Not Specified

Virtual Machine: Sun JVM - 1.6
Platform: Tomcat - 5.5


 Description  « Hide

Following construct doesn't work in a Controller.

Superclass:
@RequestMapping(params = "action=edit", method = RequestMethod.GET)
public String delete(@RequestParam("id") ID id) {...}

Subclass:
@Override
public String delete(@RequestParam("id") Integer id) {...}

ID extends Serialiazable.

The HandlerMethodResolver resolved the method Subclass.delete(Serializable).
This is incorrect: it should get the bridged method Subclass.delete(Integer), so it can resolve the @RequestParam annotations.

I think this wil be fixed if BridgeMethodResolver.findBridgedMethod(method) is called after using ClassUtils.getMostSpecificMethod().



Juergen Hoeller added a comment - 02/Oct/08 09:41 AM

Thanks for reporting this! We indeed need to apply BridgeMethodResolver here - after resolution of the handler method (which still happens based on the @RequestMapping annotation on the superclass method) but before invocation of the method (which requires resolution of annotated parameters).

Juergen