Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8398509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:04:23+00:00 2026-06-09T21:04:23+00:00

In my jsp file I have <script type=text/javascript src=/resources/scripts/jWebSocket.js></script> <script type=text/javascript> //jws.browserSupportsWebSockets checks if

  • 0

In my jsp file I have

  <script type="text/javascript" src="/resources/scripts/jWebSocket.js"></script>

  <script type="text/javascript">
  //jws.browserSupportsWebSockets checks if web sockets are available
  //either natively, by the FlashBridge or by the ChromeFrame.
  if( jws.browserSupportsWebSockets() ) {
  jWebSocketClient = new jws.jWebSocketJSONClient();
  // Optionally enable GUI controls here
  } else {
  // Optionally disable GUI controls here
  var lMsg = jws.MSG_WS_NOT_SUPPORTED;
  alert(lMsg);
 }

  var lURL = jws.getDefaultSSLServerURL() + "/;timeout=360000";
 alert(lURL);

     /* var lRes = jWebSocketClient.broadcastText(
    "",   // broadcast to all clients (not limited to a certain pool)
    lMsg  // broadcast this message
  );

  alert(lRes.code);
   */

  function broadcast() {

        var lMsg = "This is test message";
        var lTarget = "*";
        if( lMsg.length > 0 ) {
            //log( USR, OUT, lMsg );
            var lRes;
            if( !lTarget || lTarget == "*") {
                alert(lMsg);
                lRes = jWebSocketClient.broadcastText(
                    "",         // broadcast to all clients (not limited to a certain pool)
                    lMsg        // broadcast this message
                );
            } else {
                lRes = jWebSocketClient.sendText(
                    lTarget,    // broadcast to all clients (not limited to a certain pool)
                    lMsg        // broadcast this message
                );
            }
            // log error only, on success don't confuse the user
            if( lRes.code != 0 ) {
                alert(lRes.msg);
                //log( SYS, OUT, "broadcast: " + lRes.msg );
            }
            // eMessage.value = "";
        }
        //doFocus( eMessage );
    }     

   </script>

It does not go to else part of this if( jws.browserSupportsWebSockets() ). it means browser supports websockets.

At last it goes to if( lRes.code != 0 ) and alert “Not connected”

Am I missing something. Please help

In my terminal window I am getting this message

 TCPEngine: SSL engine 'tcp0' started' at port 9797 with default timeout infinite.
 2012-08-15 09:52:45,979 DEBUG - JWebSocketFactory: Starting servers...
 2012-08-15 09:52:45,980 INFO  - TokenServer: Token server 'ts0' started.
 2012-08-15 09:52:45,980 INFO  - JWebSocketFactory: jWebSocket server startup complete

it means server is running.

When I alert lURL from below code

 var lURL = jws.getDefaultSSLServerURL() + "/;timeout=360000"; in my jsp file.

it prints

    wss://localhost:9797/jWebSocket/jWebSocket/;timeout=360000
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:04:24+00:00Added an answer on June 9, 2026 at 9:04 pm

    Yes. You are missing the logon call. Add the following lines (instead of where your alert(lUrl) is):

    jWebSocketClient.logon( lURL, "guest", "guest", {
    
       OnOpen: function( aEvent ){
       // something to do when connection is established
       }
    
       OnMessage: function( aEvent, aToken ){
       // something to do when a message is recieved
       }
    }
    

    the first "guest" is username and the second is password. if you haven’t changed yet the jwebsocket.conf file in your server, than there should be a user with these credentials.

    let know if this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this .jsp file: <script language=javascript> <c:if test=1!=2> </c:if> </script> and I got
For simplicity, i have the following file named test.jsp: <script language=javascript> alert(a$b.replace(/\$/g,k)); </script> I
I have the following JSP File and Servlet file <html> <head> <meta http-equiv=Content-Type content=text/html;
I have a .jsp file that receives a request and checks the request's parameters.
In a web project using jsp, I have following requirement Upload a file (say
I have JSP with javascript in the title of it. Script need to be
I have a jsp page as: <html> <head> <title>Try in JNLP</title> <script src=http://www.java.com/js/deployJava.js></script> <script>
I have an index.jsp file located in 'WEB-INF/jsp/' and I am referencing a CSS
In my .jsp file I have the code below. How can I compare the
I have a jsp file: validate.jsp- var rollNo=document.forms[result_form][studentRollno].value; var name=document.forms[result_form][studentName].value; $(#student_result).load(result.jsp?rollNo=+rollNo+&name=+name); As you can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.