Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] web.xml and jsr 356 end points

I looked at all these as follows


javax.websocket.server.ServerEndpoint Annotation scanning : The document says that all classes annotated are scanned by 9.2 by default if they are in lib dir, checked this, they are inlib dir


javax.servlet.ServletContextListener : the servletContext retuns null for getAttribute(javax.websocket.server.ServerContainer.class.getName())


javax.websocket.server.ServerApplicationConfig : Thi sis never invoked.


Please suggest what can be done here, am running out of all options.

-          Anu


From: jetty-users-bounces@xxxxxxxxxxx [mailto:jetty-users-bounces@xxxxxxxxxxx] On Behalf Of Joakim Erdfelt
Sent: Wednesday, July 30, 2014 4:33 PM
To: JETTY user mailing list
Subject: Re: [jetty-users] web.xml and jsr 356 end points


JSR-356 does not support adding websocket endpoints via web.xml or via servlets.


Go read up on javax.websocket.server.ServerContainer (both the object and the ServletContext attribute)


You'll have a few choices:


* javax.websocket.server.ServerEndpoint Annotation scanning

* javax.servlet.ServletContextListener

* javax.websocket.server.ServerApplicationConfig



Joakim Erdfelt <joakim@xxxxxxxxxxx>

Expert advice, services and support from from the Jetty & CometD experts


On Wed, Jul 30, 2014 at 1:24 PM, Padki, Anuradha <anuradha.padki@xxxxxxxx> wrote:

Hello all,


I can get the jsr356 working by manually adding the endpoints to the servletContainer as

wscontainer = WebSocketServerContainerInitializer.configureContext(context); WebSocketServerContainerInitializer.configureContext(context);



However, I already have a jetty project that uses jetty.xml and web.xml for all other servlets, so I am trying to figure out how to add the end points via web.xml

Any help is greatly appreciated.



jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit


Back to the top