Discover jersey restful web services, include the articles, news, trends, analysis and practical advice about jersey restful web services on alibabacloud.com
/
GET
Lists all members of the resource collection.
Retrieves a representation of a resource identified as 1234.
PUT
An update (replace) with a collection also has a collection.
Update the digital resource labeled 1234.
POST
Creates a digital resource in the collection whose ID is assigned on its own initiative.
Create a child resource in the following.
DELETE
Deletes the entire collection of r
members of the resource collection.
put
post
delete
delete marked as1234 of digital resources.
JSR 311 (jax-rs) and Jersey
The proposal for a JSR 311 or jax-rs (Java API for RESTful Web Services) began in 2007, 1.0 and finalized i
Developing RESTful WEB Services seamlessly support exposing your data in a variety of representation media types and Abstract away the low-level details of the client-server communication is not a easy task without a good toolkit. In order to simplify development of RESTful WEB
Jersey is a JAX-RS implementation, Jax-rs Java API for RESTful Web Services, which supports the creation of a WEB service according to the Representational state Transfer (REST) architectural style. The most important concept in REST is resources, which are identified by usi
Building restful Web services based on Jersey and Apache Tomcat (ii) The previous blog introduced rest and jersey and used it to build a simple "Hello world", so this time, a little more interesting things, of course, is also very simple, just include parameters in the path
entered in the browser Http://localhost:8080/myapp/application.wadl, the miracle appeared, as shown in (⊙o⊙) ...The next hint appears http://localhost:8080/myapp/myresource, returning a string of textual information. Such asWhy is this access path, and why return to got it! What the hell is going on here. I don't know anything!Com.example also has a file, Myresource.java, open it up and see.Package Com.example;import Javax.ws.rs.get;import Javax.ws.rs.path;import javax.ws.rs.produces;import jav
Jersey Client API BasicsTo get started with the Jersey client API, you first need to create an instance of the Com.sun.jersey. Api.client.Client class. Here's the simplest approach:Import Com.sun.jersey. api.client.Client;Client client = Client.create ();The client class is the primary configuration point for creating a RESTful
Jersey is a RESTful request Service Java framework, similar to the struts framework used by regular Java programming, and is primarily used to process the business logic layer. Similar to struts, it can also be integrated with the hibernate,spring framework. Because struts2+hibernate+spring integration in the market share is too high, so few people to pay attention to J
This article refers to the following:[1] Starting out with Jersey Apache Tomcat using IntelliJ[2] "Jersey" IntelliJ idea + Maven + Jetty + Jersey build RESTful servicesThanks to the two authors.0. Create a new projectCreate a new project in IntelliJ, select the Java Enterprise, RE
, "/*"); try {server.start (); Server.join (); "Catch (Exception e) {25 E.printstacktrace (); 26}27 28}29}The first of the red font is the port number, you can set it yourself, the second one needs to be modified by yourself, that is, the package name where the first Hellojersey.java is located.OK, right click, Run "Startentity.main ()"To access Http://localhost:8090/hello in the browser, or use the test RESTful
>Jersey WEB ApplicationServlet-name> A Url-pattern>/webapi/*Url-pattern> at servlet-mapping> - Web-app>Deploy to Tomcat, start the server, Url:http://localhost:8080/jerseydemo/webapi/myresourceThen write your own two demo, the code is as follows:1 Packagecom.wudi.test;2 3 ImportJavax.ws.rs.GET; 4 ImportJavax.ws.rs.Path; 5 Importjavax.ws.rs.Produces;
Create a digital resource in a collectionCreate a child resource below.DELETE Deletes the entire collection of resources.Delete the digital resource labeled 1234.II: REST and JSR (Jersey)JSR-311 Java API for RESTful Web Services (JAX-RS) 1.0 and 1.1Jax-rs is a new technology that will be generated in Java EE 6. Jax-rs
or update a resource
Create or update a resource with ID 1234
DELETE
Delete a resource
Delete a resource with ID 1234
Jersey
Jersey is Sun's production quality reference implementation for JSR 311:jax-rs:the Java APIs for RESTful Web Services
50 interfaces, annotations, and abstract classes:Javax.ws.rs: Contains high-level (high-level) interfaces and annotations for creating restful service resources;Javax.ws.rs.core: Contains low-level (low-level) interfaces and annotations for creating restful service resources;Javax.ws.rs.ext: Contains APIs for extending the type of Jax-rs API support;Note: The JAX-RS specification simply defines the API, an
Source: HTTP://PAN.BAIDU.COM/S/1GDIN4FPReprint please specify original address: http://blog.csdn.net/tianyijavaoracle/article/details/41708217Jersey is the Jax-rs (JSR311) Open source reference implementation for building RESTful WEB service. In addition , Jersey provides some additional APIs and extension mechanisms so developers can scale
then instead it's necessary to declare the Jersey specific Servlet and pass th E Application implementation class name as one of the servlet ' s Init-param entries:Web-app> servlet> Servlet-name>Jersey WEB ApplicationServlet-name> Servlet-class>Com.sun.jersey.spi.container.servlet.ServletContainerServlet-class> Init-param> Para
2018-4-6
OK, I have to admit, because Axis2 did not walk, so changed the use of Jersey, because the previous time used to feel very easy to use.
Specific jersey is what, at present completely do not understand, the next 1 days time to try.
--it's not going to be.
I. Summary of resource addresses required below
apache Maven
apache
"Other tutorials in this series are being translated, click on Category: Spring 4 mvc for viewing. Source download address at the end of the article. 】
"Translation by clearly like the month QQ 605283073" original address: http://websystique.com/springmvc/ spring-mvc-4-restful-web-services-crud-example-resttemplate/
Previous: Spring 4 MVC @RestController Annotat
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.