• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the need of Restful services

 
Dilip Ganesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,

I have a question about Restful web services. Servlet also can generate the response as a XML or JSON , servlet can also work on HTTP methods.

So what is the need of Restful web services using the servlet also we can achieve right?

Please give me some real world examples

Thanks

Dilip
 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RESTful web service is an architectural pattern.
A convenient way to implement it in the java world is using servlets, since both cater to the HTTP protocol.
But it's not the only way. RESTful services can exist outside a servlet container, unlike servlets...it is possible to implement them using plain sockets and deploy them standalone.

 
Dilip Ganesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply.

Karthik Shiraly wrote: RESTful services can exist outside a servlet container, unlike servlets...it is possible to implement them using plain sockets and deploy them standalone.


How it is possible with out using the container implement the restful services?

 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get your question. Are you asking how is it possible in principle, or are you asking how to do it using some specific framework?
In principle, as already mentioned, a standalone process can bind to some port using sockets, receive RESTful HTTP requests on it, and reply back with HTTP responses.
A framework like Jersey already supports this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic