
RESTful Java with JAX-RS 2.0
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Cover
- Copyright
- Table of Contents
- Foreword
- Preface
- Author's Note
- Who Should Read This Book
- How This Book Is Organized
- Part I, REST and the JAX-RS Standard
- Part II, JAX-RS Workbook
- Conventions Used in This Book
- Using Code Examples
- Safari® Books Online
- How to Contact Us
- Acknowledgments
- Part I. REST and the JAX-RS Standard
- Chapter 1. Introduction to REST
- REST and the Rebirth of HTTP
- RESTful Architectural Principles
- Addressability
- The Uniform, Constrained Interface
- Why Is the Uniform Interface Important?
- Representation-Oriented
- Communicate Statelessly
- HATEOAS
- Wrapping Up
- Chapter 2. Designing RESTful Services
- The Object Model
- Model the URIs
- Defining the Data Format
- Read and Update Format
- Create Format
- Assigning HTTP Methods
- Browsing All Orders, Customers, or Products
- Obtaining Individual Orders, Customers, or Products
- Creating an Order, Customer, or Product
- Updating an Order, Customer, or Product
- Removing an Order, Customer, or Product
- Cancelling an Order
- Wrapping Up
- Chapter 3. Your First JAX-RS Service
- Developing a JAX-RS RESTful Service
- Customer: The Data Class
- CustomerResource: Our JAX-RS Service
- JAX-RS and Java Interfaces
- Inheritance
- Deploying Our Service
- Writing a Client
- Wrapping Up
- Chapter 4. HTTP Method and URI Matching
- Binding HTTP Methods
- HTTP Method Extensions
- @Path
- Binding URIs
- @Path Expressions
- Matrix Parameters
- Subresource Locators
- Full Dynamic Dispatching
- Gotchas in Request Matching
- Wrapping Up
- Chapter 5. JAX-RS Injection
- The Basics
- @PathParam
- More Than One Path Parameter
- Scope of Path Parameters
- PathSegment and Matrix Parameters
- Programmatic URI Information
- @MatrixParam
- @QueryParam
- Programmatic Query Parameter Information
- @FormParam
- @HeaderParam
- Raw Headers
- @CookieParam
- @BeanParam
- Common Functionality
- Automatic Java Type Conversion
- @DefaultValue
- @Encoded
- Wrapping Up
- Chapter 6. JAX-RS Content Handlers
- Built-in Content Marshalling
- javax.ws.rs.core.StreamingOutput
- java.io.InputStream, java.io.Reader
- java.io.File
- byte[]
- String, char[]
- MultivaluedMap&String, String& and Form Input
- javax.xml.transform.Source
- JAXB
- Intro to JAXB
- JAXB JAX-RS Handlers
- JAXB and JSON
- JSON and JSON Schema
- Custom Marshalling
- MessageBodyWriter
- MessageBodyReader
- Life Cycle and Environment
- Wrapping Up
- Chapter 7. Server Responses and Exception Handling
- Default Response Codes
- Successful Responses
- Error Responses
- Complex Responses
- Returning Cookies
- The Status Enum
- javax.ws.rs.core.GenericEntity
- Exception Handling
- javax.ws.rs.WebApplicationException
- Exception Mapping
- Exception Hierarchy
- Wrapping Up
- Chapter 8. JAX-RS Client API
- Client Introduction
- Bootstrapping with ClientBuilder
- Client and WebTarget
- Building and Invoking Requests
- Invocation
- Exception Handling
- Configuration Scopes
- Wrapping Up
- Chapter 9. HTTP Content Negotiation
- Conneg Explained
- Preference Ordering
- Language Negotiation
- Encoding Negotiation
- JAX-RS and Conneg
- Method Dispatching
- Leveraging Conneg with JAXB
- Complex Negotiation
- Negotiation by URI Patterns
- Leveraging Content Negotiation
- Creating New Media Types
- Flexible Schemas
- Wrapping Up
- Chapter 10. HATEOAS
- HATEOAS and Web Services
- Atom Links
- Advantages of Using HATEOAS with Web Services
- Link Headers Versus Atom Links
- HATEOAS and JAX-RS
- Building URIs with UriBuilder
- Relative URIs with UriInfo
- Building Links and Link Headers
- Writing Link Headers
- Embedding Links in XML
- Wrapping Up
- Chapter 11. Scaling JAX-RS Applications
- Caching
- HTTP Caching
- Expires Header
- Cache-Control
- Revalidation and Conditional GETs
- Concurrency
- JAX-RS and Conditional Updates
- Wrapping Up
- Chapter 12. Filters and Interceptors
- Server-Side Filters
- Server Request Filters
- Server Response Filters
- Reader and Writer Interceptors
- Client-Side Filters
- Deploying Filters and Interceptors
- Ordering Filters and Interceptors
- Per-JAX-RS Method Bindings
- DynamicFeature
- Name Bindings
- DynamicFeature Versus @NameBinding
- Exception Processing
- Wrapping Up
- Chapter 13. Asynchronous JAX-RS
- AsyncInvoker Client API
- Using Futures
- Using Callbacks
- Futures Versus Callbacks
- Server Asynchronous Response Processing
- AsyncResponse API
- Exception Handling
- Cancel
- Status Methods
- Timeouts
- Callbacks
- Use Cases for AsyncResponse
- Wrapping Up
- Chapter 14. Deployment and Integration
- Deployment
- The Application Class
- Deployment Within a JAX-RS-Aware Container
- Deployment Within a JAX-RS-Unaware Container
- Configuration
- Basic Configuration
- EJB Integration
- Spring Integration
- Wrapping Up
- Chapter 15. Securing JAX-RS
- Authentication
- Basic Authentication
- Digest Authentication
- Client Certificate Authentication
- Authorization
- Authentication and Authorization in JAX-RS
- Enforcing Encryption
- Authorization Annotations
- Programmatic Security
- Client Security
- Verifying the Server
- OAuth 2.0
- Signing and Encrypting Message Bodies
- Digital Signatures
- Encrypting Representations
- Wrapping Up
- Chapter 16. Alternative Java Clients
- java.net.URL
- Caching
- Authentication
- Advantages and Disadvantages
- Apache HttpClient
- Authentication
- Advantages and Disadvantages
- RESTEasy Client Proxies
- Advantages and Disadvantages
- Wrapping Up
- Part II. JAX-RS Workbook
- Chapter 17. Workbook Introduction
- Installing RESTEasy and the Examples
- Example Requirements and Structure
- Code Directory Structure
- Environment Setup
- Chapter 18. Examples for Chapter 3
- Build and Run the Example Program
- Deconstructing pom.xml
- Running the Build
- Examining the Source Code
- Chapter 19. Examples for Chapter 4
- Example ex04_1: HTTP Method Extension
- Build and Run the Example Program
- The Server Code
- The Client Code
- Example ex04_2: @Path with Expressions
- Build and Run the Example Program
- The Server Code
- The Client Code
- Example ex04_3: Subresource Locators
- Build and Run the Example Program
- The Server Code
- The Client Code
- Chapter 20. Examples for Chapter 5
- Example ex05_1: Injecting URI Information
- The Server Code
- The Client Code
- Build and Run the Example Program
- Example ex05_2: Forms and Cookies
- The Server Code
- Build and Run the Example Program
- Chapter 21. Examples for Chapter 6
- Example ex06_1: Using JAXB
- The Client Code
- Changes to pom.xml
- Build and Run the Example Program
- Example ex06_2: Creating a Content Handler
- The Content Handler Code
- The Resource Class
- The Application Class
- The Client Code
- Build and Run the Example Program
- Chapter 22. Examples for Chapter 7
- Example ex07_1: ExceptionMapper
- The Client Code
- Build and Run the Example Program
- Chapter 23. Examples for Chapter 9
- Example ex09_1: Conneg with JAX-RS
- The Client Code
- Build and Run the Example Program
- Example ex09_2: Conneg via URL Patterns
- The Server Code
- Build and Run the Example Program
- Chapter 24. Examples for Chapter 10
- Example ex10_1: Atom Links
- The Server Code
- The Client Code
- Build and Run the Example Program
- Example ex10_2: Link Headers
- The Server Code
- The Client Code
- Build and Run the Example Program
- Chapter 25. Examples for Chapter 11
- Example ex11_1: Caching and Concurrent Updates
- The Server Code
- The Client Code
- Build and Run the Example Program
- Chapter 26. Examples for Chapter 12
- Example ex12_1 : ContainerResponseFilter and DynamicFeature
- The Server Code
- The Client Code
- Build and Run the Example Program
- Example ex12_2: Implementing a WriterInterceptor
- The Client Code
- Build and Run the Example Program
- Chapter 27. Examples for Chapter 13
- Example ex13_1: Chat REST Interface
- The Client Code
- The Server Code
- Build and Run the Example Program
- Chapter 28. Examples for Chapter 14
- Example ex14_1: EJB and JAX-RS
- Project Structure
- The EJBs
- The Remaining Server Code
- The Client Code
- Build and Run the Example Program
- Example ex14_2: Spring and JAX-RS
- Build and Run the Example Program
- Chapter 29. Examples for Chapter 15
- Example ex15_1: Custom Security
- One-Time Password Authentication
- Allowed-per-Day Access Policy
- Build and Run the Example Program
- Example ex15_1: JSON Web Encryption
- Build and Run the Example Program
- Index
- About the Author
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.