In the previous section, we made another improvement to our application by enabling some live updates while using the dashboard, all this using a polling system that targets a dedicated action.
However, we saw that it wasn't enough to excite the "chatrumer"; indeed, each time he/she posts a message or a file, he/she will be redirected to a new page. That's not what we call a "user-friendly" interface.
Moreover, we did a very wild thing with the code, which was the hardcoding of a URL—that's so scary.
To recover our peace, and the user's, we're going to use the amazing features that Play! 2 is providing us with: a client-side router
and a JavaScript version of the server-side router which was used to perform redirects and so on. Both the server and the client routers are generated by Play! 2's code generator based on the routes
file.
Going even further, we'll reduce the number of forms (for posting) from twice the...