Atitit. Restful service overview and framework Selection

Source: Internet
Author: User

Atitit. Restful service overview and framework Selection

 

1. RestBasic concepts:1

2. urlNote:1

3. 1

4. Restful framework selection 2

1. Spring MVC (Recomm) 2

2. Jersey 2

5. Reference 3

 

1. Rest Basic concepts:

· Everything in rest is considered a resource.

· Each resource is identified by a URI.

· Use unified interfaces. The Post, get, put, and delete operations for processing resources are similar to the CREATE, read, update, and delete (crud) operations.

· Stateless. Each request is an independent request. Each request from the client to the server must contain all necessary information for your understanding.

· Communication is presented. For example, XML, JSON

Restful web services simply replace soap-based Web Services and are accepted by large service providers. This article using the Jersey framework extends the JAX-RS API to demonstrate how to create a rest-style Web Service and client.

 

In Russia's summary, URL fragment 10 has intentions ..

 

Author: old wow's paw attilax iron, email: [email protected]

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

2. url Note: 3.

Browser browsing: http: // localhost: 8080/restfulws/rest/userinfoservice/name/Pavithra

Rest: URL pattern in webxml

Uservice: CLS level path Anno

Xxmeth: Meth level path Anno

Pavithra: Anno to inject Val to meth ..

4. Restful framework Selection 1. Spring MVC (Recomm)

Springmvc rest implementation

Springmvc resturl is provided through @ requestmapping and @ pathvariable annotation,
For example, @ requestmapping (value = "/blog/{ID}", method = requestmethod. delete) can be used to process the Delete request of/blog/1.

 

2. Jersey

Jersey, as a restful framework launched by Oracle,

 

@ Get
@ Path ("/age/{J }")
@ Produces (mediatype. text_xml)
Public String userage (@ pathparam ("J") Int J ){

5. Reference

 

Developing restful services with Jersey-jie Dao jdon

Springmvc constructs a restful explanation-stick to the Foundation-blogjava

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.