RESTful Java Web Services

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Publisher: Packt Publishing
Year: 2009

Language: English
Pages: 258

Packt - RESTful Java Web Services (11-2009) (ATTiCA)......Page 0
Copyright......Page 3
Credits......Page 4
About the Author......Page 5
About the Reviewers......Page 6
Table of Contents......Page 8
Preface......Page 14
What is REST?......Page 20
Resources......Page 22
URI......Page 23
Uniform interfaces through HTTP
requests......Page 24
GET/RETRIEVE......Page 25
POST/CREATE......Page 29
PUT/UPDATE......Page 31
DELETE/DELETE......Page 33
Web services and the big picture......Page 34
Summary......Page 36
Getting the tools......Page 38
RESTful clients......Page 39
Java command-line application......Page 40
Jakarta Commons HTTP Client......Page 43
Java desktop application......Page 45
JSP application......Page 49
Servlet application......Page 51
Summary......Page 55
Semantic search mashup......Page 56
Application architecture......Page 58
Web application definition......Page 59
User interface layer......Page 61
Parsing JSON structures......Page 71
Servlet layer......Page 73
SemanticHacker parser Servlet......Page 74
Google search Servlet......Page 76
Twitter search Servlet......Page 77
Yahoo search Servlet......Page 79
Yahoo image search Servlet......Page 80
Summary......Page 81
Designing a RESTful web service......Page 82
Requirements of sample web service......Page 83
Resource identification......Page 84
XML representations......Page 85
JSON representations......Page 88
URI definition......Page 89
Using URIs to request representation types......Page 91
Summary......Page 92
Getting the tools......Page 94
Jersey the JAX-RS 1.1 reference
implementation......Page 95
@Path......Page 96
@GET......Page 97
@DELETE......Page 98
@PathParam......Page 99
@Consumes......Page 101
@Produces......Page 102
@FormParam......Page 103
Web service architecture......Page 104
Persistence layer......Page 105
RESTful web service implementation
with Jersey......Page 106
Application deployment......Page 107
/users......Page 108
/users/{username}......Page 116
/messages......Page 122
/messages/{messageID}......Page 128
/messages/users/{username}......Page 132
/messages/search/{search_item}......Page 134
Summary......Page 137
Getting the tools......Page 138
Restlet......Page 139
Restlet application and URI mappings......Page 140
HTTP GET and content negotiation (HTTP Accept header)......Page 141
HTTP POST......Page 143
HTTP PUT......Page 144
HTTP DELETE......Page 145
Restlet application and URI mappings......Page 146
/users......Page 148
/users/{username}......Page 152
/messages......Page 156
/messages/{messageID}......Page 157
/messages/users/{username}......Page 159
/messages/search/{search_item}......Page 160
Restlet application and URI mappings......Page 162
@Get and content negotiation (HTTP Accept header)......Page 163
@Post......Page 164
@Delete......Page 165
Implementation using Restlet 2.0......Page 166
URIs and resources......Page 167
/users......Page 168
/users/{username}......Page 171
/messages......Page 175
/messages/{messageID}......Page 176
/messages/users/{username}......Page 178
/messages/search/{search_item}......Page 179
Summary......Page 180
Getting the tools......Page 182
Web service architecture......Page 183
RESTful web service implementation with RESTEasy......Page 184
Application deployment......Page 185
/users......Page 187
/users/{username}......Page 188
/messages......Page 189
/messages/{messageID}......Page 190
/messages/users/{username}......Page 191
Summary......Page 192
Getting the tools......Page 194
REST plugin......Page 195
URI mappings......Page 196
HTTP request handlers......Page 197
Web service architecture......Page 198
RESTful web service implementation with Struts 2......Page 199
Application deployment......Page 200
/users and /users/{username}......Page 202
/messages and /messages/{messageID}......Page 210
/usermessages/{username}......Page 213
/searchmessages/{search_item}......Page 214
Summary......Page 215
Getting the tools......Page 216
HTTP GET requests......Page 217
HTTP POST requests......Page 218
HTTP PUT requests......Page 220
HTTP DELETE requests......Page 221
Restlet servers......Page 222
Summary......Page 231
Securing web services......Page 232
Custom token authentication......Page 233
HTTP basic authentication......Page 235
OAuth — accessing web services on behalf
of users......Page 241
High availability......Page 243
Scalability......Page 244
On-demand infrastructures......Page 245
Performance recommendations......Page 246
Summary......Page 247
Index......Page 248