Summary

In this chapter, we have seen how to create a RESTful API with Spring MVC. This kind of backend yields great benefits in terms of performance and maintenance and can do wonders when coupled with a JavaScript MVC framework such as Backbone, Angular JS, or React.js.

We saw how to handle errors and exceptions properly and learned how to leverage the HTTP status to make a better API.

Finally we added automatic documentation with Swagger and added the ability to produce both XML and JSON.

In the next chapter, we will learn how to secure our application as well as use the Twitter API to sign our users up.

Get Spring MVC: Designing Real-World Web Applications 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.