Chapter 7. Enhancing a Restlet application with recipes and best practices

 

This chapter covers

  • Handling common web artifacts such as forms and cookies
  • How servers can redirect clients
  • Handling file uploads on the client and server side
  • Improving the performance of Restlet applications
  • Splitting a large Restlet application into several modules

As you near the end of the second part of this book, you’ve already read about many important topics that required dedicated chapters, such as dealing with representations and securing and documenting your web API. But many important questions have yet to be covered—questions that still matter when you want to bring your Restlet application closer to production.

First you’ll see how to deal with common Restlet developer needs, such as handling web forms, cookies, and file uploads. We also explain how Restlet can replace a classic web server by serving static files, how to customize default error pages, and how to deal with web feeds.

Then we explain how to redirect client calls, at first manually and then in a more sophisticated way with the Redirector class, with both client-side and server-side redirections. We continue exploring Restlet with features and best practices to improve performance such as streaming and compression of representations, caching, and conditional processing.

7.1. Handling common web elements

7.2. Dealing with Atom and RSS feeds

7.3. Redirecting client calls

7.4. Improving performances

7.5. Modularizing large applications

7.6. Persisting resources state

7.7. Summary