rest using jersey java - How to create simple REST web service using jersey

How to create simple REST web service using jersey

Posted on

rest using jersey java - How to create simple REST web service using jerseyOn this tutorial I’ll display you what Relaxation is and how you can develop a easy relaxation net service in java utilizing jersey. Earlier than transferring ahead let see what relaxation is.

  • REST stands for Representational State Switch. (It’s generally spelled “ReST”.)
  • It depends on a stateless, client-server, cacheable communications protocol which makes use of HTTP protocol.
  • REST is a less complicated, light-weight various to RPC (Distant Process Calls) and Net Companies (SOAP, WSDL, and so on). Know extra different between Rest and SOAP.

I’ll use solar’s JAX-RS reference implementation Jersey to display easy greeting service.

Create new Java EE undertaking in eclipse and add all dependent jar information in classpath. You’ll be able to obtain associated jars from https://jersey.java.net website.

RESTful in eclipse - How to create simple REST web service using jersey

Your net.xml will look just like …

Right here you possibly can see net.xml comprise one servlet named ServletContainer which has url sample related to it.

Now write one class which is our foremost REST net service class.

This REST based mostly net service can be accessable utilizing following URL.

http://localhost:8080/RESTfulTest/relaxation/greeting/tousif

output jersey web service - How to create simple REST web service using jersey

Download

Supply techzoo.org