You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent interpretation of parameter annotations in interface-based handler methods [SPR-14021] #18593
and class, which is derived from this interface, but arguments of methods are not annotated with Param annotations mapper behaviour is inconsistent:
values, annotated with @RequestParam get their values in implementing class, and with @PathVariable — not.
Annotations on method parameters are expected to be in the implementing class. I'm not sure why @RequestParam works. Could you provide a sample project (the repro repository might help)?
Now, when Spring Cloud project exists — it's good idea to have single interface for endpoint and FeignClient, because client is declarative and is being build depending on annotations.
Sorry for not seeing this right away but @RequestParam is the default for simple types. As long as the method argument name matches the request parameter name, it just works and the annotation doesn't have to be present. In other words you can remove those annotations and it would still work.
Activity
spring-projects-issues commentedon Mar 5, 2016
Greg Turnquist commented
Moved to Spring Framework since this involves Spring MVC.
spring-projects-issues commentedon Mar 5, 2016
Paul commented
I'm sorry, didn't know where to post it to.
Thank you for your help.
spring-projects-issues commentedon Mar 7, 2016
Rossen Stoyanchev commented
Annotations on method parameters are expected to be in the implementing class. I'm not sure why
@RequestParamworks. Could you provide a sample project (the repro repository might help)?spring-projects-issues commentedon Mar 8, 2016
Paul commented
Now, when Spring Cloud project exists — it's good idea to have single interface for endpoint and FeignClient, because client is declarative and is being build depending on annotations.
spring-projects-issues commentedon Mar 8, 2016
Paul commented
Reproduce tests in pull request: spring-attic/spring-framework-issues#120
spring-projects-issues commentedon Mar 8, 2016
Rossen Stoyanchev commented
Sorry for not seeing this right away but
@RequestParamis the default for simple types. As long as the method argument name matches the request parameter name, it just works and the annotation doesn't have to be present. In other words you can remove those annotations and it would still work.spring-projects-issues commentedon Mar 8, 2016
Rossen Stoyanchev commented
Resolving as duplicate of #15682.