Skip to content

Commit

Permalink
Docs + tests for play.http.actionComposition.includeWebSocketActions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed Aug 21, 2023
1 parent dc5be30 commit 4cd36c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Expand Up @@ -302,6 +302,8 @@ trait JavaActionCompositionSpec extends PlaySpecification with WsTestClient {
}
}

// TODO tests for play.http.actionComposition.includeWebSocketActions

"When action composition is configured to invoke request handler action first" should {
"execute request handler action first and action composition before controller composition" in makeRequest(
new ComposedController {
Expand Down
Expand Up @@ -141,3 +141,5 @@ websocat -vv --close-status-code 1000 --close-reason "bye bye" ws://127.0.0.1:90
If clients send close status codes other than the default 1000 to your Play app, make sure they use the ones that are defined and valid according to [RFC 6455 Section 7.4.1](https://www.rfc-editor.org/rfc/rfc6455#section-7.4.1) to avoid any problems. For example web browsers usually throw exceptions when trying to use such status codes and some server implementations (e.g. Netty) fail with exceptions if they receive them (and close the connection).

> **Note:** The akka-http specific configs `akka.http.server.websocket.periodic-keep-alive-max-idle` and `akka.http.server.websocket.periodic-keep-alive-mode` do **not** affect Play. To be backend server agnostic, Play uses its own low-level WebSocket implementation and therefore handles frames itself.
# TODO play.http.actionComposition.includeWebSocketActions
Expand Up @@ -135,3 +135,5 @@ When using [[compile-time Dependency Injection|JavaCompileTimeDependencyInjectio
@[action-composition-compile-time-di](code/javaguide/http/JavaActionsComposition.java)

> **Note:** As stated above, every request **must** be served by a distinct instance of your `play.mvc.Action` and that is why you add a `java.util.function.Supplier<Action>` instead of the instance itself. Of course, you can have a `Supplier` returning the same instance every time, but this is not encouraged.
# TODO play.http.actionComposition.includeWebSocketActions
Expand Up @@ -39,6 +39,8 @@ If you want to explicitly select a body parser, this can be done using the [`@Bo

@[particular-body-parser](code/javaguide/http/JavaBodyParsers.java)

TODO: bodyparser annotation will be ignored when on WebSocketAction because can't have a body and will always be empty

The body parsers that Play provides out of the box are all inner classes of the [`BodyParser`](api/java/play/mvc/BodyParser.html) class. Briefly, they are:

- [`Default`](api/java/play/mvc/BodyParser.Default.html): The default body parser.
Expand Down

0 comments on commit 4cd36c7

Please sign in to comment.