Using JAX-RS annotations to build RESTful web services

Java annotations provide the metadata for your Java class, which can be used during compilation, deployment, or at runtime in order to perform designated tasks. The use of annotations allows us to create RESTful web services as easily as we develop a POJO class. Here, we leave the interception of the HTTP requests and representation negotiations to the framework and concentrate on the business rules necessary to solve the problem at hand.

If you are not familiar with Java annotations, go through the tutorial available at: http://docs.oracle.com/javase/tutorial/java/annotations/.

We will take a quick look at some of the very frequently used JAX-RS annotations in this section. Note that the next section does not provide a comprehensive list of all the JAX-RS annotations; we will see more annotations as we proceed further in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.75.217