Chapter 11. Managing Application State
This chapter covers
- Building an enhanced Comet service
- Working with the GWT history system
- Using standard servlet state
Everything is in a state of flux, including the status quo.
Robert Byrne
In this chapter we’re going to examine an example application we call “State of the Union.” This application demonstrates state management in a long-lived fashion, using log files to capture state on the server with the standard Java Servlet API. This will be done in the context of a GWT application, and within the GWT history system we introduced in chapter 1.
We’ll cover using the History class to update the client state as the model changes, as well as deal with state on the server, representing state in the client, and exploring the possible cases where handling user actions is important. Before we get there, though, we’ll take a look at implementing a publisher-subscriber messaging system on the server, and at using XML as a non-RPC data representation. All the while, we’ll emphasize the placement of these techniques in the context of an MVC pattern on the client.