SlideShare a Scribd company logo
1 of 23
 Representational
◦ Clients possess the information necessary to
identify, modify, and/or delete a web resource.
 State
◦ All resource state information is stored on the
client.
 Transfer
◦ Client state is passed from the client to the
service through HTTP.
REST stands for Representational State Transfer
 It is an architectural pattern for developing
web services as opposed to a specification.
 REST web services communicate over the
HTTP specification, using HTTP vocabulary:
◦ Methods (GET, POST, etc.)
◦ HTTP URI syntax (paths, parameters, etc.)
◦ Media types (xml, json, html, plain text, etc)
◦ HTTP Response codes.
The six characteristics of REST:
1. Uniform interface
2. Decoupled client-server interaction
3. Stateless
4. Cacheable
5. Layered
6. Extensible through code on demand
(optional)
* Services that do not conform to the above
required contstraints are not strictly RESTful
web services.
 The HTTP request is sent from the client.
◦ Identifies the location of a resource.
◦ Specifies the verb, or HTTP method to use when
accessing the resource.
◦ Supplies optional request headers (name-value pairs)
that provide additional information the server may
need when processing the request.
◦ Supplies an optional request body that identifies
additional data to be uploaded to the server (e.g. form
parameters, attachments, etc.)
Sample Client Requests:
 A typical client GET request:
 A typical client POST request:
GET /view?id=1 HTTP/1.1
User-Agent: Chrome
Accept: application/json
[CRLF]
POST /save HTTP/1.1
User-Agent: IE
Content-Type: application/x-www-form-urlencoded
[CRLF]
name=x&id=2
Requested Resource (path and query string)
Request Headers
Request Body (e.g. form parameters)
Requested Resource (typically no query string)
Request Headers
(no request body)
 The HTTP response is sent from the server.
◦ Gives the status of the processed request.
◦ Supplies response headers (name-value pairs) that
provide additional information about the response.
◦ Supplies an optional response body that identifies
additional data to be downloaded to the client (html,
xml, binary data, etc.)
Sample Server Responses:
JSON Response
1:- it is simple and easy to understand
2:- fast processing
3:- contain keys and values in different forms
XML Response
1:- most of the news feeds and blog feeds are in xml type
2:- it contain data in the form of tags like html tags
HTTP Methods supported by REST:
 GET – Requests a resource at the request URL
◦ Should not contain a request body, as it will be discarded.
◦ May be cached locally or on the server.
◦ May produce a resource, but should not modify on it.
 POST – Submits information to the service for
processing
◦ Should typically return the new or modified resource.
 PUT – Add a new resource at the request URL
 DELETE – Removes the resource at the request
URL
 OPTIONS – Indicates which methods are
supported
 HEAD – Returns meta information about the
request URL
A typical HTTP REST URL:
 The protocol identifies the transport scheme that will
be used to process and respond to the request.
 The host name identifies the server address of the
resource.
 The path and query string can be used to identify and
customize the accessed resource.
http://my.store.com/fruits/list?category=fruit&limit=20
protocol host name path to a resource query string
A REST service framework provides a
controller for routing HTTP requests to a
request handler according to:
 The HTTP method used (e.g. GET, POST)
 Supplied path information (e.g
/service/listItems)
 Query, form, and path parameters
 Headers, cookies, etc.
REST services in Java web applications can be
implemented in several ways:
 As a plain Java Servlet
◦ Adequate for very simple REST services.
◦ Requires a lot of “boiler plate” code for
complex services.
 Using a REST service framework.
◦ Eliminates the need to write “boilerplate” code.
◦ Typically integrates with other technologies,
such as Spring.
Java provides the JAX-RS specification for use
by providers of REST service frameworks.
Although developers may implement REST
web services however they choose, the Java
Stack team is best equipped to support the
following:
 Apache CXF
◦ A JAX-RS web service framework
 Spring MVC
◦ An MVC framework built upon the Spring
Platform (does not implement the JAX-RS
specification)
Apache CXF is a robust framework designed
specifically for producing and consuming web
services:
 It is open-source and free to use.
 It supports several web service standards and
JSR APIs.
 It provides tooling and configuration for JAX-
WS and JAX-RS services.
 It provides integration with the Spring
Application Framework, the core technology
upon which most of the Java Stack is built.
Apache CXF provides robust support for several
web service patterns and specifications:
 JSR APIs: JAX-WS, JAX-RS, JSR-181 annotations, SAAJ
 WS-* specifications for web service interoperability.
 Rich support support for message transports, protocol
bindings, content negotiation, data bindings, and so
forth.
 Flexible, lightweight deployment in a variety of web
application containers or stand-alone.
 Tooling for code generation
 Tools for WSDL and WADL publishing.
Spring MVC is a model-view-controller
framework built upon the Spring Application
Framework.
 Annotation driven
 Supports a RESTful pattern of routing
requests to web resources using HTTP
vocabulary.
 Not an implementation of the JAX-RS
specification.
JAX-RS HTTP Method Annotations:
@GET @POST
@PUT @DELETE
@OPTIONS @HEAD
 Applied to a Java method to bind it to an HTTP
method.
 Only one HTTP annotation may be applied to a
single Java method.
 Multiple Java methods may be given the same
HTTP method annotation, assuming they are
bound to different paths.
 @Path annotations may be supplied to customize
the request URI of resource.
 @Path on a class defines the base relative path for
all resources supplied by that class.
 @Path on a Java class method defines the relative
path for the resource bound to that method.
 @Path on a method is relative to any @Path on the
class.
 In the absence of @Path on the class or method,
the resource is defined to reside at the root of the
service.
 A leading forward slash (/) is unnecessary as the
path is always relative.
 Common JAX-RS Parameter Annotations:
◦ @QueryParam – maps to a query string parameter.
◦ @FormParam – maps to a form POST parameter.
◦ @PathParam – maps to a path segment.
◦ @DefaultValue – supplies a default parameter value.
 Most often used on service methods to
annotate input parameters.
 Can also be used on fields or field setter
methods if the service bean has request
scope.
 Additional parameter annotations are also
available.
◦ See the JAX-RS API documentation for details.
@Produces
 Used on a class or method to identify the
content types that can be produced by
that resource class or method.
 Method annotation overrides class
annotation
 If not specified, CXF assumes any type
(*/*) can be produced.
 CXF responds with HTTP status “406 Not
Acceptable” if no appropriate method is
found.
@Consumes
 Used on a class or method to identify the
content types that can be accepted by that
resource class or method.
 Method annotation overrides class
annotation
 If not specified, CXF assumes any type
(*/*) is acceptable.
 CXF responds with HTTP status “406 Not
Acceptable” if no appropriate method is
found.
Examples of @Produces and @Consumes:
 The client submits JSON or XML content with the
“Content-Type” header.
 The client requests either JSON or XML content
through use of the HTTP “Accept” request header.
@Path("example")
public class ExampleRestService {
@POST
@Path("items")
@Produces({"application/json", "application/xml"})
@Consumes({"application/json", "application/xml"})
public List<Item> editItems(List<Item> items) {
// Does something and returns the modified list
}
}
 As a requirement of JAX-RS, CXF
automatically provides support for reading
and writing XML to and from JAXB
annotated classes.
 CXF also provides built-in support for
reading and writing JSON to and from JAXB
annotated classes.
◦ Default support uses Jettison as the JSON
provider
◦ The Stack RS namespace handler will
automatically configure Jackson as the JSON
provider if it is on the classpath.

More Related Content

What's hot

RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful ArchitectureKabir Baidya
 
Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0Dmytro Chyzhykov
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedDhananjay Nene
 
Api wiki · git hub
Api wiki · git hubApi wiki · git hub
Api wiki · git hubFerry Irawan
 
A Conversation About REST - Extended Version
A Conversation About REST - Extended VersionA Conversation About REST - Extended Version
A Conversation About REST - Extended VersionJeremy Brown
 
Impact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilityImpact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilitySanchit Gera
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)David Krmpotic
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
Representational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASRepresentational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASGuy K. Kloss
 
WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0Jeffrey West
 
Lunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud
 
A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2VivekKrishna34
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About RESTMike Wilcox
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with ODataMahek Merchant
 

What's hot (20)

RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful Architecture
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0Making Java REST with JAX-RS 2.0
Making Java REST with JAX-RS 2.0
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Api wiki · git hub
Api wiki · git hubApi wiki · git hub
Api wiki · git hub
 
A Conversation About REST - Extended Version
A Conversation About REST - Extended VersionA Conversation About REST - Extended Version
A Conversation About REST - Extended Version
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Impact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and ScalabilityImpact of Restful Web Architecture on Performance and Scalability
Impact of Restful Web Architecture on Performance and Scalability
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
REST API Design
REST API DesignREST API Design
REST API Design
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Representational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASRepresentational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOAS
 
WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0
 
Lunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's Guide
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest and Rails
Rest and RailsRest and Rails
Rest and Rails
 
A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 

Viewers also liked

Religiones más importantes en el mundo
Religiones más importantes en el mundoReligiones más importantes en el mundo
Religiones más importantes en el mundoNicole Granda
 
Industrial Training in PhoneGap Application
Industrial Training in PhoneGap ApplicationIndustrial Training in PhoneGap Application
Industrial Training in PhoneGap ApplicationArcadian Learning
 
Red de-computadoras
Red de-computadorasRed de-computadoras
Red de-computadorasMary A Secas
 
Religiones mas importantes
Religiones  mas importantesReligiones  mas importantes
Religiones mas importantesLilia Siavichay
 
Dens evaginatus- a problem based approach
Dens evaginatus- a problem based approachDens evaginatus- a problem based approach
Dens evaginatus- a problem based approachAshok Ayer
 
Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)
Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)
Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)GoIT
 
[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1
[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1
[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1paul8331
 
ENC Times- February 04,2017
ENC Times- February 04,2017ENC Times- February 04,2017
ENC Times- February 04,2017ENC
 

Viewers also liked (13)

Boxeo
BoxeoBoxeo
Boxeo
 
informatica
informaticainformatica
informatica
 
Sistema de administración de información. Yetsaid Rondon CI:23.616.810
Sistema de administración de información. Yetsaid Rondon CI:23.616.810Sistema de administración de información. Yetsaid Rondon CI:23.616.810
Sistema de administración de información. Yetsaid Rondon CI:23.616.810
 
Religiones más importantes en el mundo
Religiones más importantes en el mundoReligiones más importantes en el mundo
Religiones más importantes en el mundo
 
Cabrera Florencia Analia
Cabrera Florencia AnaliaCabrera Florencia Analia
Cabrera Florencia Analia
 
Industrial Training in PhoneGap Application
Industrial Training in PhoneGap ApplicationIndustrial Training in PhoneGap Application
Industrial Training in PhoneGap Application
 
Red de-computadoras
Red de-computadorasRed de-computadoras
Red de-computadoras
 
Religiones mas importantes
Religiones  mas importantesReligiones  mas importantes
Religiones mas importantes
 
Dens evaginatus- a problem based approach
Dens evaginatus- a problem based approachDens evaginatus- a problem based approach
Dens evaginatus- a problem based approach
 
Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)
Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)
Mobile Saturday. Тема 5. Особенности операционной системы iOS (Ольга Макаревич)
 
[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1
[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1
[경기창조경제혁신센터] 앙뜨프리너십 Bootcamp Season.1
 
ENC Times- February 04,2017
ENC Times- February 04,2017ENC Times- February 04,2017
ENC Times- February 04,2017
 
L14. Anomaly Detection
L14. Anomaly DetectionL14. Anomaly Detection
L14. Anomaly Detection
 

Similar to 6 Months Industrial Training in Spring Framework

Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with javaVinay Gopinath
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web ServiceHoan Vu Tran
 
The introduction of RESTful
The introduction of RESTful The introduction of RESTful
The introduction of RESTful Jon Chen
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling ResolutionDEEPAK KHETAWAT
 
Java Servlets
Java ServletsJava Servlets
Java ServletsEmprovise
 
Ppt on web development and this has all details
Ppt on web development and this has all detailsPpt on web development and this has all details
Ppt on web development and this has all detailsgogijoshiajmer
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyPayal Jain
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
Api design and development
Api design and developmentApi design and development
Api design and developmentoquidave
 
How to call REST API without knowing any programming languages
How to call REST API without knowing any programming languages How to call REST API without knowing any programming languages
How to call REST API without knowing any programming languages Marc Leinbach
 
#6 (RESTtful Web Wervices)
#6 (RESTtful Web Wervices)#6 (RESTtful Web Wervices)
#6 (RESTtful Web Wervices)Ghadeer AlHasan
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1vikram singh
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technologyvikram singh
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 

Similar to 6 Months Industrial Training in Spring Framework (20)

Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with java
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
The introduction of RESTful
The introduction of RESTful The introduction of RESTful
The introduction of RESTful
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
ROA.ppt
ROA.pptROA.ppt
ROA.ppt
 
Ppt on web development and this has all details
Ppt on web development and this has all detailsPpt on web development and this has all details
Ppt on web development and this has all details
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
 
Rest web service
Rest web serviceRest web service
Rest web service
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Api design and development
Api design and developmentApi design and development
Api design and development
 
How to call REST API without knowing any programming languages
How to call REST API without knowing any programming languages How to call REST API without knowing any programming languages
How to call REST API without knowing any programming languages
 
Rest
RestRest
Rest
 
#6 (RESTtful Web Wervices)
#6 (RESTtful Web Wervices)#6 (RESTtful Web Wervices)
#6 (RESTtful Web Wervices)
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Rest Webservice
Rest WebserviceRest Webservice
Rest Webservice
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 

More from Arcadian Learning

StackLabs-DataDriven Labs - iPhone App Development Training in Mohali
StackLabs-DataDriven Labs - iPhone App Development  Training in MohaliStackLabs-DataDriven Labs - iPhone App Development  Training in Mohali
StackLabs-DataDriven Labs - iPhone App Development Training in MohaliArcadian Learning
 
Industrial Training in Window Application
Industrial Training in Window ApplicationIndustrial Training in Window Application
Industrial Training in Window ApplicationArcadian Learning
 
Best Industrial Training in Android
Best Industrial Training in AndroidBest Industrial Training in Android
Best Industrial Training in AndroidArcadian Learning
 
6 Weeks Industrial Training in Android Application
6 Weeks Industrial Training in Android Application   6 Weeks Industrial Training in Android Application
6 Weeks Industrial Training in Android Application Arcadian Learning
 
6 Weeks Industrial Training in Testing
6 Weeks Industrial Training in Testing 6 Weeks Industrial Training in Testing
6 Weeks Industrial Training in Testing Arcadian Learning
 
Industrial Training in Software Testing
Industrial Training in Software TestingIndustrial Training in Software Testing
Industrial Training in Software TestingArcadian Learning
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Industrial Training in Mobile Application
Industrial Training in Mobile ApplicationIndustrial Training in Mobile Application
Industrial Training in Mobile ApplicationArcadian Learning
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with MavenArcadian Learning
 
OpenStack Training in Mohali
OpenStack Training in MohaliOpenStack Training in Mohali
OpenStack Training in MohaliArcadian Learning
 
6 Months Industrial Training in Android
6 Months Industrial Training in Android6 Months Industrial Training in Android
6 Months Industrial Training in AndroidArcadian Learning
 
6 Months Industrial Training in Big Data in Chandigarh
6 Months Industrial Training in Big Data in Chandigarh6 Months Industrial Training in Big Data in Chandigarh
6 Months Industrial Training in Big Data in ChandigarhArcadian Learning
 
6 Weeks Industrial Training In Telecom In Chandigarh
6 Weeks Industrial Training In Telecom In Chandigarh6 Weeks Industrial Training In Telecom In Chandigarh
6 Weeks Industrial Training In Telecom In ChandigarhArcadian Learning
 
Cloud Computing Industrial Training In Chandigarh
Cloud Computing Industrial Training In ChandigarhCloud Computing Industrial Training In Chandigarh
Cloud Computing Industrial Training In ChandigarhArcadian Learning
 
Cloud Computing Platform-CloudStack
Cloud Computing Platform-CloudStackCloud Computing Platform-CloudStack
Cloud Computing Platform-CloudStackArcadian Learning
 
Android Training in Chandigarh
Android Training in ChandigarhAndroid Training in Chandigarh
Android Training in ChandigarhArcadian Learning
 
Application Development -iOS
Application Development -iOSApplication Development -iOS
Application Development -iOSArcadian Learning
 

More from Arcadian Learning (20)

StackLabs-DataDriven Labs - iPhone App Development Training in Mohali
StackLabs-DataDriven Labs - iPhone App Development  Training in MohaliStackLabs-DataDriven Labs - iPhone App Development  Training in Mohali
StackLabs-DataDriven Labs - iPhone App Development Training in Mohali
 
Industrial Training in Window Application
Industrial Training in Window ApplicationIndustrial Training in Window Application
Industrial Training in Window Application
 
Best Industrial Training in Android
Best Industrial Training in AndroidBest Industrial Training in Android
Best Industrial Training in Android
 
6 Weeks Industrial Training in Android Application
6 Weeks Industrial Training in Android Application   6 Weeks Industrial Training in Android Application
6 Weeks Industrial Training in Android Application
 
6 Weeks Industrial Training in Testing
6 Weeks Industrial Training in Testing 6 Weeks Industrial Training in Testing
6 Weeks Industrial Training in Testing
 
Industrial Training in Software Testing
Industrial Training in Software TestingIndustrial Training in Software Testing
Industrial Training in Software Testing
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Industrial Training in Mobile Application
Industrial Training in Mobile ApplicationIndustrial Training in Mobile Application
Industrial Training in Mobile Application
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
 
Training in iOS Development
Training in iOS DevelopmentTraining in iOS Development
Training in iOS Development
 
OpenStack Training in Mohali
OpenStack Training in MohaliOpenStack Training in Mohali
OpenStack Training in Mohali
 
MongoDB Training
MongoDB TrainingMongoDB Training
MongoDB Training
 
Virtualization Training
Virtualization TrainingVirtualization Training
Virtualization Training
 
6 Months Industrial Training in Android
6 Months Industrial Training in Android6 Months Industrial Training in Android
6 Months Industrial Training in Android
 
6 Months Industrial Training in Big Data in Chandigarh
6 Months Industrial Training in Big Data in Chandigarh6 Months Industrial Training in Big Data in Chandigarh
6 Months Industrial Training in Big Data in Chandigarh
 
6 Weeks Industrial Training In Telecom In Chandigarh
6 Weeks Industrial Training In Telecom In Chandigarh6 Weeks Industrial Training In Telecom In Chandigarh
6 Weeks Industrial Training In Telecom In Chandigarh
 
Cloud Computing Industrial Training In Chandigarh
Cloud Computing Industrial Training In ChandigarhCloud Computing Industrial Training In Chandigarh
Cloud Computing Industrial Training In Chandigarh
 
Cloud Computing Platform-CloudStack
Cloud Computing Platform-CloudStackCloud Computing Platform-CloudStack
Cloud Computing Platform-CloudStack
 
Android Training in Chandigarh
Android Training in ChandigarhAndroid Training in Chandigarh
Android Training in Chandigarh
 
Application Development -iOS
Application Development -iOSApplication Development -iOS
Application Development -iOS
 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 

6 Months Industrial Training in Spring Framework

  • 1.
  • 2.  Representational ◦ Clients possess the information necessary to identify, modify, and/or delete a web resource.  State ◦ All resource state information is stored on the client.  Transfer ◦ Client state is passed from the client to the service through HTTP.
  • 3. REST stands for Representational State Transfer  It is an architectural pattern for developing web services as opposed to a specification.  REST web services communicate over the HTTP specification, using HTTP vocabulary: ◦ Methods (GET, POST, etc.) ◦ HTTP URI syntax (paths, parameters, etc.) ◦ Media types (xml, json, html, plain text, etc) ◦ HTTP Response codes.
  • 4. The six characteristics of REST: 1. Uniform interface 2. Decoupled client-server interaction 3. Stateless 4. Cacheable 5. Layered 6. Extensible through code on demand (optional) * Services that do not conform to the above required contstraints are not strictly RESTful web services.
  • 5.  The HTTP request is sent from the client. ◦ Identifies the location of a resource. ◦ Specifies the verb, or HTTP method to use when accessing the resource. ◦ Supplies optional request headers (name-value pairs) that provide additional information the server may need when processing the request. ◦ Supplies an optional request body that identifies additional data to be uploaded to the server (e.g. form parameters, attachments, etc.)
  • 6. Sample Client Requests:  A typical client GET request:  A typical client POST request: GET /view?id=1 HTTP/1.1 User-Agent: Chrome Accept: application/json [CRLF] POST /save HTTP/1.1 User-Agent: IE Content-Type: application/x-www-form-urlencoded [CRLF] name=x&id=2 Requested Resource (path and query string) Request Headers Request Body (e.g. form parameters) Requested Resource (typically no query string) Request Headers (no request body)
  • 7.  The HTTP response is sent from the server. ◦ Gives the status of the processed request. ◦ Supplies response headers (name-value pairs) that provide additional information about the response. ◦ Supplies an optional response body that identifies additional data to be downloaded to the client (html, xml, binary data, etc.)
  • 8. Sample Server Responses: JSON Response 1:- it is simple and easy to understand 2:- fast processing 3:- contain keys and values in different forms XML Response 1:- most of the news feeds and blog feeds are in xml type 2:- it contain data in the form of tags like html tags
  • 9. HTTP Methods supported by REST:  GET – Requests a resource at the request URL ◦ Should not contain a request body, as it will be discarded. ◦ May be cached locally or on the server. ◦ May produce a resource, but should not modify on it.  POST – Submits information to the service for processing ◦ Should typically return the new or modified resource.  PUT – Add a new resource at the request URL  DELETE – Removes the resource at the request URL  OPTIONS – Indicates which methods are supported  HEAD – Returns meta information about the request URL
  • 10. A typical HTTP REST URL:  The protocol identifies the transport scheme that will be used to process and respond to the request.  The host name identifies the server address of the resource.  The path and query string can be used to identify and customize the accessed resource. http://my.store.com/fruits/list?category=fruit&limit=20 protocol host name path to a resource query string
  • 11. A REST service framework provides a controller for routing HTTP requests to a request handler according to:  The HTTP method used (e.g. GET, POST)  Supplied path information (e.g /service/listItems)  Query, form, and path parameters  Headers, cookies, etc.
  • 12. REST services in Java web applications can be implemented in several ways:  As a plain Java Servlet ◦ Adequate for very simple REST services. ◦ Requires a lot of “boiler plate” code for complex services.  Using a REST service framework. ◦ Eliminates the need to write “boilerplate” code. ◦ Typically integrates with other technologies, such as Spring. Java provides the JAX-RS specification for use by providers of REST service frameworks.
  • 13. Although developers may implement REST web services however they choose, the Java Stack team is best equipped to support the following:  Apache CXF ◦ A JAX-RS web service framework  Spring MVC ◦ An MVC framework built upon the Spring Platform (does not implement the JAX-RS specification)
  • 14. Apache CXF is a robust framework designed specifically for producing and consuming web services:  It is open-source and free to use.  It supports several web service standards and JSR APIs.  It provides tooling and configuration for JAX- WS and JAX-RS services.  It provides integration with the Spring Application Framework, the core technology upon which most of the Java Stack is built.
  • 15. Apache CXF provides robust support for several web service patterns and specifications:  JSR APIs: JAX-WS, JAX-RS, JSR-181 annotations, SAAJ  WS-* specifications for web service interoperability.  Rich support support for message transports, protocol bindings, content negotiation, data bindings, and so forth.  Flexible, lightweight deployment in a variety of web application containers or stand-alone.  Tooling for code generation  Tools for WSDL and WADL publishing.
  • 16. Spring MVC is a model-view-controller framework built upon the Spring Application Framework.  Annotation driven  Supports a RESTful pattern of routing requests to web resources using HTTP vocabulary.  Not an implementation of the JAX-RS specification.
  • 17. JAX-RS HTTP Method Annotations: @GET @POST @PUT @DELETE @OPTIONS @HEAD  Applied to a Java method to bind it to an HTTP method.  Only one HTTP annotation may be applied to a single Java method.  Multiple Java methods may be given the same HTTP method annotation, assuming they are bound to different paths.
  • 18.  @Path annotations may be supplied to customize the request URI of resource.  @Path on a class defines the base relative path for all resources supplied by that class.  @Path on a Java class method defines the relative path for the resource bound to that method.  @Path on a method is relative to any @Path on the class.  In the absence of @Path on the class or method, the resource is defined to reside at the root of the service.  A leading forward slash (/) is unnecessary as the path is always relative.
  • 19.  Common JAX-RS Parameter Annotations: ◦ @QueryParam – maps to a query string parameter. ◦ @FormParam – maps to a form POST parameter. ◦ @PathParam – maps to a path segment. ◦ @DefaultValue – supplies a default parameter value.  Most often used on service methods to annotate input parameters.  Can also be used on fields or field setter methods if the service bean has request scope.  Additional parameter annotations are also available. ◦ See the JAX-RS API documentation for details.
  • 20. @Produces  Used on a class or method to identify the content types that can be produced by that resource class or method.  Method annotation overrides class annotation  If not specified, CXF assumes any type (*/*) can be produced.  CXF responds with HTTP status “406 Not Acceptable” if no appropriate method is found.
  • 21. @Consumes  Used on a class or method to identify the content types that can be accepted by that resource class or method.  Method annotation overrides class annotation  If not specified, CXF assumes any type (*/*) is acceptable.  CXF responds with HTTP status “406 Not Acceptable” if no appropriate method is found.
  • 22. Examples of @Produces and @Consumes:  The client submits JSON or XML content with the “Content-Type” header.  The client requests either JSON or XML content through use of the HTTP “Accept” request header. @Path("example") public class ExampleRestService { @POST @Path("items") @Produces({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"}) public List<Item> editItems(List<Item> items) { // Does something and returns the modified list } }
  • 23.  As a requirement of JAX-RS, CXF automatically provides support for reading and writing XML to and from JAXB annotated classes.  CXF also provides built-in support for reading and writing JSON to and from JAXB annotated classes. ◦ Default support uses Jettison as the JSON provider ◦ The Stack RS namespace handler will automatically configure Jackson as the JSON provider if it is on the classpath.

Editor's Notes

  1. Notes: The @PathParam value maps to a matched path segement from the @Path annotation. The @Path annotation value can uses the {} notation to identify a path segment. Regular expressions can also be used with care inside the {} of the @Path annotation {:regex} for matching path parameters.