The request-response life cycle

The Play Framework uses Netty by default, so requests are received by NettyServer.

Netty allows a variety of actions including custom coding through handlers. We can define a handler that transforms a request into a desired response and provides it to Netty when bootstrapping the application. To integrate a Play app with Netty, PlayDefaultUpstreamHandler is used.

Note

For additional information on requests used in Netty, refer to Netty docs at http://netty.io/wiki/user-guide-for-4.x.html and Netty ChannelPipeline docs at http://netty.io/4.0/api/io/netty/channel/ChannelPipeline.html.

PlayDefaultUpstreamHandler extends org.jboss.netty.channel.SimpleChannelUpstreamHandler to handle both HTTP and WebSocket requests. It ...

Get Mastering Play Framework for Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.