A Java based project that shows an example of using Spring's @RequestMapping annotation for serving not only http requests but also as a websocket endpoint.
A Controller that needs to serve both websocket and http requests should simply extends WebSocketEndpoint
- Java 7 is installed on your machine (For just running the example you may download only the JRE from here)
- Environment variable
JAVA_HOMEis set with the location of a JAVA home dir
To compile and run the tests, open your command line console in the project root and type:
mvnw install
For executing the demo:
-
type:
mvnw exec:java -
Open your browser and navigate to
http://localhost:8080/index.jsp
To facilitate the compile process the project uses maven-wrapper-plugin.
To make the execution easy it uses embedded tomcat and Exec Maven Plugin