All things web-related in a Java EE container is most likely exposed using a Servlet. The Java EE 7 WebSocket server endpoints are no different. Should one therefore not be able to get hold of the HttpSession object from within a ServerEndpoint class?
Yes it is doable. I exemplified a solution in code as a posted answer over at stackoverflow.com. Enjoy!
Hi,
Have any idea how we can get the httpsession if a websocket endpoint class is singleton ?