Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I necessarily need a third party framework for a Java-based REST service (JSON)?

Of course JAX-RS should work without any additional framework like JAX-WS also does. But in JAX-WS, I just put some annotations on a POJO, create a self hosted service with one single line of code and that's it.

I can't find any tutorials or resources that show how to do the same with JAX-RS. Nearly every tutorial uses Jersey (or Easyrest etc.) and at least Maven. Isn't there an easy way to set up a Rest based service like it can be done with JAX-WS?

Thank you

edit: Hm, I think annotations like @Path etc. aren't available without these frameworks? My eclipse cannot reference/find them :(

like image 322
ceran Avatar asked Feb 09 '12 08:02

ceran


People also ask

Is RESTful Web Services a framework?

The Jersey RESTful web services framework is the reference implementation for the JAX-RS specification.

Which REST framework can be used to create RESTful web services?

REST has now become a standard way to develop web services, and When it comes to Java, there are many frameworks and libraries available, like JAX-RS, Restlet, Jersey, RESTEasy, Apache CFX, etc.. Still, I encourage Java developers to use Spring MVC to develop RESTful web services.


1 Answers

JAX-RS is an API. Jersey and RESTEasy are its implementations. Jersey, is the 'reference' implementation of JAX-RS, and therefore shows up frequently in tutorials (after all, one needs some implementation of the API to use it).

http://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services

like image 160
ArjunShankar Avatar answered Oct 15 '22 08:10

ArjunShankar