I am trying to develop a Java EE 7 web application that uses a websocket endpoint and deploy it on a Jetty server.
The application has the following structure:
Game/
src/
main/
java/
game/
WebSocketEndpoint.java
webapp/
index.html
scripts/
variousjavascriptstuff.js
WEB-INF/
beans.xml
web.xml
In the beans.xml file:
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="annotated">
WebSocketEndpoint is annotated properly and works fine with Netbeans/Glassfish4, however, the application must be deployed on a Jetty server.
So, my question - How do I map the websocket endpoint to the URL /game in the web.xml file? I have found a number of examples for mapping servlets, but I do not think that this will work for a server endpoint.
Or, is there a way to write a web.xml file for Jetty so that it automatically discovers ll annotated classes/methods (similar to the above beans.xml)