Results 1 to 2 of 2
  1. #1
    Kenan_89 is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Embed JWebSocket to tomcat and test it

    Hi guys,

    I am trying since yesterday to embed JWebSocket into my

    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:

    XML Code:
    <!DOCTYPE html>
    	<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
    	<form action="#" id="chat_form" method = "post">
    		<input id="msg">
    		<input type="submit" value="senden">
    		var websocket = new WebSocket('ws://localhost:8080/');
    		websocket.onopen = function(event){
    			$('#chat').append('<br> Connection...');
    		websocket.onmessage = function(event){
    		websocket.onclose = function(event){
    			$('#chat').append("<br> closed");
    				var textfield = $('#msg');
    Thanks in ahead for help.

    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.

  2. #2
    Kenan_89 is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Re: Embed JWebSocket to tomcat and test it

    Hmm, now I get a text in the console in chrome:

    "Error during WebSocket HandShake. Header is missing"

    What does this mean?

Similar Threads

  1. embed JRE
    By invegat in forum Forum Lobby
    Replies: 1
    Last Post: 02-05-2012, 06:27 AM
  2. Replies: 0
    Last Post: 10-20-2011, 10:10 AM
  3. how to embed .jar in web page?
    By clydedoris in forum New To Java
    Replies: 0
    Last Post: 03-10-2010, 12:54 AM
  4. Replies: 0
    Last Post: 04-05-2008, 12:38 AM
  5. Tomcat In Eclipse - Sysdeo Tomcat Plug-in
    By JavaForums in forum Eclipse
    Replies: 1
    Last Post: 02-13-2008, 10:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts