12.07.2015 Views

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ CONTENTSFrom the Web to Web Services ............................................................................................................ 460A Web-Browsing Experience ................................................................................................................ 460Uniform Interface.................................................................................................................................. 461Addressability....................................................................................................................................... 461Connectedness ..................................................................................................................................... 462Statelessness ....................................................................................................................................... 463<strong>Java</strong> API for RESTful Web Services................................................................................463The JAX-RS Model................................................................................................................................ 464How to Write a REST Service................................................................................................................ 464URI Definition........................................................................................................................................ 465Extracting Parameters.......................................................................................................................... 467Consuming and Producing Content Types............................................................................................ 468Entity Provider ...................................................................................................................................... 471Methods or the Uniform Interface......................................................................................................... 473Contextual Information ......................................................................................................................... 474Exception Handling............................................................................................................................... 475Life Cycle.............................................................................................................................................. 476Putting It All Together ....................................................................................................477Writing the Book Entity......................................................................................................................... 477Writing the BookResource.................................................................................................................... 478Configuring Jersey................................................................................................................................ 481Compiling and Packaging <strong>with</strong> Maven ................................................................................................. 481Deploying on <strong>GlassFish</strong>......................................................................................................................... 482Running the Example............................................................................................................................ 483Summary .......................................................................................................................484■Index........................................................................................................................485xvi

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!