Results 1 to 2 of 2
- 05-31-2012, 10:36 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 25
- Rep Power
- 0
Embed JWebSocket to tomcat and test it
Hi guys,
I am trying since yesterday to embed JWebSocket into my
webapps.
Which Tomcat I am using?
I user tomcat apache-tomcat-6.0.20
What I`ve done until now?
-I copied jWebSocketAppServer-0.9.0.war into the tomcat webapps file
-I copied jWebSocketServer-Bundle-0.9.0.jar into the lib file of my webapp called "chat"
What is the next step? I unfortunatly have no idea :(
How can I find out, my JWebSocket works correctly?
I have this code from a html5 book:
Thanks in ahead for help.XML Code:<!DOCTYPE html> <html> <head> <title>Websocket</title> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> </head> <body> <form action="#" id="chat_form" method = "post"> <input id="msg"> <input type="submit" value="senden"> </form> <script> var websocket = new WebSocket('ws://localhost:8080/'); websocket.onopen = function(event){ $('#chat').append('<br> Connection...'); } websocket.onmessage = function(event){ $('#chat').append(event.data); } websocket.onclose = function(event){ $('#chat').append("<br> closed"); } $(function(){ $('form#chat_form').submit(function(e){ e.preventDefault(); var textfield = $('#msg'); websocket.send(textfield.val()); textfield.val(""); }) }); </script> </body> </html>
***EDIT:
Further I found out I need a class that implements ServletContextListener. But because I user Tomcat 7 in the past
I cannot assign my projects tomcat 6 server. I need tomcat 6 server because jWebsocket isnt supported by Tomcat 7.
In an website I read that I have to switch the Servlet API from 3.0 to 2.5. But how can I do this?Last edited by Kenan_89; 05-31-2012 at 12:49 PM.
- 05-31-2012, 12:50 PM #2
Member
- Join Date
- Jan 2012
- Posts
- 25
- Rep Power
- 0
Similar Threads
-
embed JRE
By invegat in forum Forum LobbyReplies: 1Last Post: 02-05-2012, 06:27 AM -
Exception in tomcat 6.0.Unable to launch the tomcat properly even in the eclipse
By medoju srinivas in forum Advanced JavaReplies: 0Last Post: 10-20-2011, 10:10 AM -
how to embed .jar in web page?
By clydedoris in forum New To JavaReplies: 0Last Post: 03-10-2010, 12:54 AM -
Test Advisory Panel-Telecommute- Test your Java skills + share insights on Java tests
By michelle in forum Jobs OfferedReplies: 0Last Post: 04-05-2008, 12:38 AM -
Tomcat In Eclipse - Sysdeo Tomcat Plug-in
By JavaForums in forum EclipseReplies: 1Last Post: 02-13-2008, 10:33 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks