Thursday, 24 May 2012

"Restful WebServices" - in NutShell

Intro:
  1) REST is an Arch style, based on
                     a) Web Standards
                     b) HTTP Protocol

  2) Everything is a "RESOURCE"
  3) REST Client ---> REST Service
  4) Resources are identified as "Global IDs" (URLs)
  5) HTTP Methods  -  (GET, PUT, POST, DELETE)
  6) MIME Types are - (XML , Text, JSON, User-defined..)
  7) JAX-RS supports
                  a)  XML
                  b)  JSON (via JAXB)

 8) JAVA -> REST -> JERSEY

 9) Register Servlet provided by Jersey Via "Web.xml"
 10) Define the PATH, under which your Application is available
     
       Base URL of Servlet is


http://your_domain:port/display-name/url-pattern/path_from_rest_class

 11)This servlet which analyze the incoming HTTP request and select the correct class and method to respond to this request. This selection is based on annotation in the class and methods.
 12) The complete path to a resource is therefore based on the base URL and the @PATh annotation in your class.

http://your_domain:port/display-name/url-pattern/path_from_rest_class

13) JERSEY - contains "Rest Server" + "Rest Client"

No comments:

Post a Comment