jeudi 11 juin 2015

storing fields in Java ee websocket

i have created a javaee websocket endpoint using a PathParam. The parameter and the session are each stored in a field @OnOpen.

The websocket listens to some event and send some data out to session (using the path parameter).

The problem is that both fields are null at the moment event is caught. What is the cause of this? Are there multiple instances of endpoint per session? I read the spec : "If the developer uses the default ServerEndpointConfig.Configurator, there will be precisely one endpoint instance per active client connection. "

So what is the problem here?

Aucun commentaire:

Enregistrer un commentaire