-1

We currently use DWR but we have problems due to its inability to use POST (it forces the use of GET when script tag is enabled) so we're thinking to migrate to HTML5 WebSockets.

What are the pros and cons of the two technologies? I couldn't find any comparison. Our server is Java (Tomcat) and has to stay so (no Node.js or similar).

algiogia
  • 936
  • 2
  • 14
  • 40
  • Are you sure DWR uses GET, as By default DWR denies GET requests for belt and braces security, however this is customizable using the allowGetForSafariButMakeForgeryEasier=true init-param in web.xml. http://directwebremoting.org/dwr/security/script-tag-protection.html – Dev Feb 09 '17 at 08:41
  • The way we use it we need to set *allowScriptTagRemoting=true* and that forces the use of GET – algiogia Feb 09 '17 at 09:56

1 Answers1

1

You have to build by your own a web socket server, your own messaging system. I use HTML5 WebSockets between legacy non Web technology and HTML5 GUI.

I have designed protocols and messages to fit the need, using ByteBuffer Java-side and with my own ByteBuffer code JavaScript-side, based on ArrayBuffer, DataView and TextDecoder for UTF-8.

It's possible to do this in a ExecutorService into Tomcat as answered to this question.

Community
  • 1
  • 1
Aubin
  • 14,617
  • 9
  • 61
  • 84