What’s Next?

This chapter focused on programming and publishing RESTful services; the next chapter focuses on consuming such services, or the client side. Some of the sample clients make requests against major RESTful sites such as Amazon and Twitter, whereas others make requests against the services developed in this chapter. Once again, the goal is to illustrate, with working code, the various client-side APIs at the Java programmer’s disposal.

Four different APIs were considered in this chapter, but these APIs fall into three general groups:

  • The HttpServlet API, which has been around since the late 1990s, remains an excellent way to implement RESTful services. Servlets are HTTP-aware and provide convenient filtering of requests by HTTP verb. Programmers accustomed to implementing websites with servlets, JSP, and related scripting languages such as JSF or Struts, should find servlets a natural and appealing way to deliver web services as well. The servlet API is at once uncomplicated and powerful.
  • The JAX-RS and Restlet APIs take full advantage of Java annotations to advertise the RESTful aspects of implemented services. These frameworks integrate well with JAX-B technologies to automate the conversion of Java types into XML and JSON documents. JAX-RS and Restlet services, like servlet-based servlets, can be published with production-grade web servers such as Tomcat and Jetty. These APIs also mimic the routing idioms that have become so popular because of frameworks such as Rails ...

Get Java Web Services: Up and Running, 2nd Edition 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.