This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rest style Servlets & WebSockets  RSS feed

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to come up with a Web application that would help me create a Rest style API for routing my HTTP requests to a servlet. I have 5 URL's that needs to be mapped to a Servlet out of which 2 of those URL's will actually have to create a WebSocket connection. I would bundle all this into a Webapp and deploy that to Glassfish. Any suggestions on any libraries that I can look into?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given that the REST architectural style is about strict use of HTTP methods, something easily accomplished with the standard Java library, why do you think you need something extra?

Bill
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I managed to get my Rest API's exposed using the easyRest API which is the JBoss implementation of the Jax-RS specs. I now would like to have WebSockets exposed to one of those URL's and I'm done with what I wanted. I do not want to spend much time about tinkering with some Java libraries for a relatively simple workaround that I'm doing.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the Wikipedia article on WebSocket

The WebSocket Protocol is an independent TCP-based protocol. Its only relationship to HTTP is that its handshake is interpreted by HTTP servers as an Upgrade request.[1]


Thus, a WebSocket connection can not be considered a RESTful architecture. You may create the connection after a RESTful style exchange but thats it.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!