Jetty Websockets can't connect to server -
so have correctly setup jetty (eclipse based) server listening on 8080. (i put little hello world html test). if go to
http://localhost:8080/index.html
my html displayed.
now have followed tutorial, work websockets.
https://gist.github.com/manzke/1021982
the web.xml configured follow:
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>tailor</display-name> <servlet> <servlet-name>websocket</servlet-name> <servlet-class>org.sample.websocket.chatwebsocketservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>websocket</servlet-name> <url-pattern>/jetty-test/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
to connect websocket use following url:
ws://localhost:8080/jetty-test/servlet/websocket
but when click on "connect" nothing happend ?, connect doesn't seems establish..
am missing something? or url wrong?
thanks !
your web.xml wrong, replace
<url-pattern>/jetty-test/*</url-pattern>
by
<url-pattern>/servlet/*</url-pattern>
Comments
Post a Comment