I would like to use a custom WebArgumentResolver for id -> entity. Easy enough if I use request parameters: use the parameter key to determine the entity type and look up accordingly.
But I would like it to be like the @PathVariable annotation.
eg.
http://mysite.xzy/something/enquiryId/itemId would trigger this method
@RequestMapping(value = "/something/{enquiry}/{item}")
public String method(@Coerce Enquiry enquiry, @Coerce Item item)
@Coerce annotations would tell the WebArgumentResolver to use the particular service based on it's type.
Problem is working out which uri part belongs to entity.
Can someone explain how PathVariable annotation does it. And is it possible to emulate it with my custom annotation.
Thanks.