RESTful Java with JAX-RS

RESTful Java with JAX-RS

  • ただいまウェブストアではご注文を受け付けておりません。 ⇒古書を探す
  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 288 p.
  • 言語 ENG,ENG
  • 商品コード 9780596158040
  • DDC分類 006.76

Table of Contents

Foreword                                           xiii
Preface xv
Part I. REST and the JAX-RS Standard
Introduction to REST 3 (12)
REST and the Rebirth of HTTP 4 (1)
RESTful Architectural Principles 5 (8)
Addressability 6 (1)
The Uniform, Constrained Interface 7 (2)
Why Is the Uniform Interface Important? 9 (1)
Representation-Oriented 10 (1)
Communicate Statelessly 10 (1)
HATEOAS 11 (2)
Wrapping Up 13 (2)
Designing RESTful Services 15 (12)
The Object Model 15 (1)
Model the URIs 16 (1)
Defining the Data Format 17 (2)
Read and Update Format 17 (2)
Create Format 19 (1)
Assigning HTTP Methods 19 (4)
Browsing All Orders, Customers, or 19 (1)
Products
Obtaining Individual Orders, Customers, 20 (1)
or Products
Creating an Order, Customer, or Product 21 (1)
Updating an Order, Customer, or Product 22 (1)
Removing an Order, Customer, or Product 23 (1)
Cancelling an Order 23 (2)
Wrapping Up 25 (2)
Your First JAX-RS Service 27 (16)
Developing a JAX-RS RESTful Service 27 (11)
Customer: The Data Class 28 (1)
CustomerResource: Our JAX-RS Service 29 (6)
JAX-RS and Java Interfaces 35 (2)
Inheritance 37 (1)
Deploying Our Service 38 (3)
Deployment Within a Servlet Container 39 (2)
Wrapping Up 41 (2)
HTTP Method and URI Matching 43 (12)
Binding HTTP Methods 43 (2)
HTTP Method Extensions 44 (1)
Path 45 (5)
Binding URIs 45 (1)
Path Expressions 46 (4)
Matrix Parameters 50 (1)
Subresource Locators 50 (3)
Full Dynamic Dispatching 52 (1)
Wrapping Up 53 (2)
JAX-RS Injection 55 (16)
The Basics 55 (1)
PathParam 56 (4)
More Than One Path Parameter 56 (1)
Scope of Path Parameters 57 (1)
PathSegment and Matrix Parameters 57 (2)
Programmatic URI Information 59 (1)
MatrixParam 60 (1)
QueryParam 60 (1)
Programmatic Query Parameter Information 61 (1)
FormParam 61 (1)
HeaderParam 62 (1)
Raw Headers 62 (1)
CookieParam 63 (2)
Common Functionality 65 (4)
Automatic Java Type Conversion 65 (2)
DefaultValue 67 (1)
Encoded 68 (1)
Wrapping Up 69 (2)
JAX-RS Content Handlers 71 (24)
Built-in Content Marshalling 71 (6)
javax.ws.rs.core.StreamingOutput 71 (1)
java.io.InputStream, java.io.Reader 72 (2)
java.io.File 74 (1)
byte[] 74 (1)
String, char[] 75 (1)
MultivaluedMap<String, String> 76 (1)
and Form Input
javax.xml.transform.Source 76 (1)
JAXB 77 (9)
Intro to JAXB 77 (3)
JAXB JAX-RS Handlers 80 (2)
JAXB and JSON 82 (2)
JSON and JSON Schema 84 (2)
Custom Marshalling 86 (7)
MessageBodyWriter 86 (5)
MessageBodyReader 91 (1)
Life Cycle and Environment 92 (1)
Wrapping Up 93 (2)
Response Codes, Complex Responses, and 95 (10)
Exception Handling
Default Response Codes 95 (2)
Successful Responses 96 (1)
Error Responses 96 (1)
Complex Responses 97 (5)
Returning Cookies 99 (1)
The Status Enum 100 (1)
javax.ws.rs.core.GenericEntity 101 (1)
Exception Handling 102 (2)
javax.ws.rs.WebApplicationException 102 (1)
Exception Mapping 103 (1)
Wrapping Up 104 (1)
HTTP Content Negotiation 105 (14)
Conneg Explained 105 (2)
Preference Ordering 106 (1)
Language Negotiation 107 (1)
Encoding Negotiation 107 (1)
JAX-RS and Conneg 108 (7)
Method Dispatching 108 (1)
Leveraging Conneg with JAXB 109 (1)
Complex Negotiation 109 (5)
Negotiation by URI Patterns 114 (1)
Leveraging Content Negotiation 115 (2)
Creating New Media Types 115 (1)
Flexible Schemas 116 (1)
Wrapping Up 117 (2)
HATEOAS 119 (12)
HATEOAS and Web Services 120 (5)
Atom Links 120 (1)
Advantages of Using HATEOAS with Web 121 (3)
Services
Link Headers Versus Atom Links 124 (1)
HATEOAS and JAX-RS 125 (5)
Building URIs with UriBuilder 125 (2)
Relative URIs with UriInfo 127 (3)
Wrapping Up 130 (1)
Scaling JAX-RS Applications 131 (10)
Caching 131 (7)
HTTP Caching 132 (1)
Expires Header 132 (1)
Cache-Control 133 (2)
Revalidation and Conditional GETs 135 (3)
Concurrency 138 (2)
JAX-RS and Conditional Updates 139 (1)
Wrapping Up 140 (1)
Deployment and Integration 141 (14)
Deployment 141 (4)
The Application Class 142 (1)
Deployment Within a JAX-RS-Unaware 143 (1)
Container
Deployment Within a JAX-RS-Aware 144 (1)
Container
Deployment Within Java EE 6 144 (1)
Configuration 145 (4)
Older Java EE Containers 145 (4)
Within Java EE 6 Containers 149 (1)
EJB Integration 149 (3)
Spring Integration 152 (2)
Wrapping Up 154 (1)
Securing JAX-RS 155 (10)
Authentication 156 (3)
Basic Authentication 156 (1)
Digest Authentication 157 (1)
Client Certificate Authentication 158 (1)
Authorization 159 (1)
Authentication and Authorization in JAX-RS 159 (5)
Enforcing Encryption 161 (1)
Authorization Annotations 162 (1)
Programmatic Security 163 (1)
Wrapping Up 164 (1)
RESTful Java Clients 165 (14)
java.net.URL 165 (5)
Caching 167 (1)
Authentication 167 (2)
Advantages and Disadvantages 169 (1)
Apache HttpClient 170 (4)
Authentication 172 (1)
Advantages and Disadvantages 173 (1)
RESTEasy Client Framework 174 (3)
Authentication 176 (1)
Advantages and Disadvantages 177 (1)
RESTEasy Client Proxies 177 (1)
Advantages and Disadvantages 178 (1)
Wrapping Up 178 (1)
JAX-RS Implementations 179 (18)
Jersey 179 (6)
Embeddable Jersey 179 (1)
Client API 180 (1)
WADL 181 (1)
Data Formats 182 (1)
Model, View, and Controller 183 (1)
Component Integration 184 (1)
Apache CXF 185 (4)
Aggregating Request Parameters into 185 (1)
Beans
Converting Request Parameters into 186 (1)
Custom Types
Static Resolution of Subresources 187 (1)
Client API 187 (1)
Supporting Services Without JAX-RS 187 (1)
Annotations
Intercepting Requests and Responses 187 (1)
Promoting XSLT and XPath As First-Class 188 (1)
Citizens
Support for Suspended Invocations 188 (1)
Support for Multipart Formats 188 (1)
Integration with Distributed OSGi RI 188 (1)
Support for WADL 188 (1)
Component Integration 189 (1)
JBoss RESTEasy 189 (5)
Embedded Container 189 (1)
Asynchronous HTTP 190 (1)
Interceptor Framework 191 (1)
Client ``Browser'' Cache 192 (1)
Server-Side Caching 192 (1)
GZIP Compression 192 (1)
Data Formats 192 (2)
Component Integration 194 (1)
Wrapping Up 194 (3)
Part II. JAX-RS Workbook
Workbook Introduction 197 (4)
Installing RESTEasy and the Examples 197 (2)
Example Requirements and Structure 199 (2)
Code Directory Structure 199 (1)
Environment Setup 199 (2)
Examples for Chapter 3 201 (10)
Build and Run the Example Program 201 (1)
Deconstructing pom.xml 202 (4)
Running the Build 206 (1)
Examining the Source Code 207 (4)
Examples for Chapter 4 211 (8)
Example ex04_1: HTTP Method Extension 211 (3)
Build and Run the Example Program 212 (1)
The Server Code 212 (1)
The Client Code 213 (1)
Example ex04_2: Path with Expressions 214 (2)
Build and Run the Example Program 214 (1)
The Server Code 214 (1)
The Client Code 215 (1)
Example ex04_3: Subresource Locators 216 (3)
Build and Run the Example Program 216 (1)
The Server Code 216 (1)
The Client Code 217 (2)
Examples for Chapter 5 219 (8)
Example ex05_1: Injecting URI Information 219 (3)
The Server Code 219 (3)
The Client Code 222 (1)
Build and Run the Example Program 222 (1)
Example ex05_2: Forms and Cookies 222 (5)
The Server Code 223 (1)
Server Configuration 224 (1)
Build and Run the Example Program 225 (2)
Examples for Chapter 6 227 (8)
Example ex06_1: Using JAXB 227 (3)
The Client Code 229 (1)
Changes to pom.xml 229 (1)
Build and Run the Example Program 230 (1)
Example ex06_2: Creating a Content Handler 230 (5)
The Content Handler Code 230 (2)
The Resource Class 232 (1)
The Application Class 232 (1)
The Client Code 233 (1)
Build and Run the Example Program 234 (1)
Examples for Chapter 7 235 (4)
Example ex07_1: ExceptionMapper 235 (4)
The Client Code 237 (1)
Build and Run the Example Program 238 (1)
Examples for Chapter 8 239 (4)
Example ex08_1: Conneg with JAX-RS 239 (2)
The Client Code 240 (1)
Build and Run the Example Program 241 (1)
Example ex08_2: Conneg via URL Patterns 241 (2)
The Server Code 241 (1)
Build and Run the Example Program 242 (1)
Examples for Chapter 9 243 (16)
Example ex09_1: Atom Links 243 (5)
The Server Code 244 (4)
The Client Code 248 (1)
Build and Run the Example Program 248 (1)
Example ex09_2: Link Headers 248 (11)
The Server Code 249 (5)
The Client Code 254 (3)
Build and Run the Example Program 257 (2)
Examples for Chapter 10 259 (6)
Example ex10_1: Caching and Concurrent 259 (6)
Updates
The Server Code 259 (3)
The Client Code 262 (1)
Build and Run the Example Program 263 (2)
Examples for Chapter 11 265 (16)
Example ex11_1: EJB and JAX-RS 265 (1)
Project Structure 265 (1)
The EJB Project 266 (6)
The WAR Project 272 (2)
The EAR Project 274 (3)
Build and Run the Example Program 277 (1)
Example ex11_2: Spring and JAX-RS 278 (3)
Build and Run the Example Program 280 (1)
Index 281