-6

I came to know about websocket in Java EE 7. so i was looking how can i implement a chat application in Java EE 7 and I found this site

Here they are mentioning that HTML 5 is required. Can anybody tell me is it necessary to use HTML 5 . if it is then why.. can i use HTML 4 ??

Puce
  • 37,247
  • 13
  • 80
  • 152

1 Answers1

2

For websockets you have to use HTML5.

https://www.websocket.org/aboutwebsocket.html

You can use various methods to implement chat functionality if you want to use HTML4 like the asyc feature of servlet 3 for chat as in the following link

https://github.com/rstoyanchev/spring-mvc-chat

For HTML4, Web Sockets are not available. Generally used mechanisms are long polling and streaming. While for HTML5, full duplex communication channels can be established with Server using Web Sockets. Accessible using JavaScript interface in HTML5 compliant browsers.

HTML4 does not allow JavaScript to run in browser. JS runs in same thread as browser interface. HTML5 allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5

Rahul Thachilath
  • 363
  • 3
  • 16