Closed
Description
Richard Larson opened SPR-7355 and commented
Given the following type of construct 2 problems arise:
- the bridged methods do not get matched and thus we get "HTTP Status 405 - Request method 'POST' not supported", for the update method.
2)The @ModelAttribute
("note") annotation on the loadModel method is not picked up from the interface.
We are using standard Spring WebMVC annotation driven setup (<mvc:annotation-driven /> and <aop:config proxy-target-class="true">) with Hibernate JPA models.
This may be related to a previous issue:
http://jira.springframework.org/browse/SPR-5191?page=com.atlassian.jirafisheyeplugin%3Acrucible-issuepanel
public interface ModelController<Model> {
@ModelAttribute("note")
public Model loadModel(@RequestParam(required = false) Long id);
@InitBinder
public void initBinder(WebDataBinder binder);
}
public interface EditableController<Model> extends ModelController<Model> {
@RequestMapping (method = RequestMethod.POST )
public String update(@Valid @ModelAttribute("note") Model command,
BindingResult result);
@RequestMapping(method = RequestMethod.GET)
public void edit(@RequestParam Long id);
}
@Controller
public class PersonController implements EditableController<Person> {
public void edit(Long id) {...}
public String update(Person command, BindingResult result) {...}
public void initBinder(WebDataBinder binder) {...}
public Person loadModel(Long id) {...}
}
Affects: 3.0.2, 3.0.3
Issue Links:
- Parameter annotations such as @RequestParam not applied from an interface [SPR-7567] #12224 Parameter annotations such as
@RequestParam
not applied from an interface