Sorry, this question sounds silly, but after developing some of my RESTful services using Jersey, I asked myself the question: if REST is just an architecture and not a protocol like SOAP, why do we need a specification like JAX -RS?
I actually googled for questions such as "What is the difference between servlets and RESTful services over HTTP" and to summarize the community responses, I got:
- Developing a RESTful service (in Jersey) is an architecture that essentially uses servlets.
- JAX-RS-compatible tools, such as Jersey, provide easy sorting / unmarshalling of XML / JSON data, helping developers.
- REST helps us use GET / POST / PUT / DELETE in a way that is more efficient than regular servlets.
According to these answers, I assume that if I write a servlet that uses JAXB (to work with automatic serialization) and I use GET / POST / PUT / DELETE effectively in my servlet code, I donβt use a tool like Jersey , and therefore JAX-RS.
I know that I am terribly mistaken in accepting this expression, please correct me.
PS: This doubt really happened when I had to develop some RESTful services in PHP. After going through some of the RESTful PHP codes, I realized that they are the same old PHP scripts, and some helper methods for processing XML / JSON.
rest jersey jax-rs
WinOrWin Aug 13 '11 at 17:34 2011-08-13 17:34
source share