Cannot use injected Request with a method returning Handler #11566
Replies: 3 comments 1 reply
-
Not sure why you think you can return a |
Beta Was this translation helpful? Give feedback.
-
But I can, and I do... My controller methods generated and return It only breaks when I try to use Request as a parameter, hence the issue. Are you saying I should just work around it myself, since this looks like an undocumented feature(using Handler directly)? |
Beta Was this translation helpful? Give feedback.
-
Controller types which are injected into the router are generated(why they are generated is another topic). For each of those controllers an interface is also generated, which is implemented by my actual business logic controllers. The generated one injects the implementation one and invokes it's methods. So the generated ones return a |
Beta Was this translation helpful? Give feedback.
-
Play Version
2.8
API
Java
Expected Behavior
play.mvc.Http.Request
and returnsplay.api.mvc.Handler
Actual Behavior
Scala compilation fails with message
Cannot use a method returning play.mvc.Http.Request => play.api.mvc.Handler as a Handler for requests
If I change return type to
CompletionStage
(for example) everything compiles as expected.Reproducible Test Case
Beta Was this translation helpful? Give feedback.
All reactions