09. Using WebSockets and HTTP
Introduction Thanks to BalusC for the valuable information! WebSockets enables server-client communication much more fluently than servlets! In long processes, you can inform the user of everything that is happening in time. In the servlets, you need to wait till the process has ended or use asynchronous servlets that are prune error. Information on WebServlets can be seen on Oracle web . and better in another post from Abhishek Gupta Here is his code but changing "javax" with " jakarta " These files are needed: A java WebSocket endpoint (EndPoint.java) A Server Endpoint Config.Configurator ( HttpSessionConfigurator.java) A client WebSocket implemented in Html with javascript code (websocket.html) EndPoint.java package gupta ; import java . io . IOException ; //import http.SessionWrapper; import jakarta . servlet . http . HttpSession ; import jakarta . websocket . EndpointConfig ; import jakarta . websocket . OnOpen ; import jakarta . websocket . Ses...