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

  • Home
  • SEARCH
  • 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 7685265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:12:47+00:00 2026-05-31T19:12:47+00:00

I want to implement something with jquery, simple javascript and java but I don’t

  • 0

I want to implement something with jquery, simple javascript and java but I don’t have any idea to do this.

Description:

  • Letter A is simple, I am just describing.

A) A user logs into the system and his userid is in session. I want to send a message by clicking a button to another user (identified with his userid) and, when the process finishes, on a db table will be a new record, like this:

message_id = 1;
sender_user_id = xxx;
recipient_user_id = yyy;
message = “hello”;

B) The recipient user if it’s logged into the system, has to receive a notification like “Hey, you got a new message” on a div that dissapears after few seconds, also a text like “inbox(0)” has to be updated to “inbox(1)”.

C) If the recipient user is not logged, when he decides to enter the system at anytime or any day, the notification has to apper and the text of “inbox(0)” have to be updated as step 2.

Notes:

  • Lots of ideas come to my mind like doing some servlet in java that returns the message count from db and this is printed by a jquery post. But how can I achieve this exactly at the momment that the message arrives or when the user logs into the system after a long time of inactivity.

  • Also a setInterval from javascript came to my mind but suppose that I program the interval to check every 5 seconds for a new message, what happens if the user sent the it and took him just 2 seconds. I think a delay happens.

So, what’s the best way to do all this?

Thanks in advance.

  • 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-05-31T19:12:48+00:00Added an answer on May 31, 2026 at 7:12 pm

    The only draw back is that not all browsers support WebSockets, and long-polling etc behave differently depending on the browser, your best bet would be to use socket.io, which works in every browser, it is mainly developed for nodejs, but there is also java implementations …

    Socket.io server : https://github.com/Ovea/Socket.IO-Java
    Socket.io client : https://github.com/Gottox/socket.io-java-client

    official site : http://www.socket.io/ -> all the examples are based on nodejs

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

Sidebar

Related Questions

I want to implement something like Col3 = Col2 + Col1 in SQL. This
I want to implement something simple like /System/Workflows/Sample Workflow with the small addition of
I want to do something like this: I tried to implement it by myself
I want to implement something similar on my site. Submissions have up_votes and down_votes.
I want to build a simple image gallery with jQuery. I have a lot
I want to implement something like autocomplete feature like this: http://jqueryui.com/demos/autocomplete/ However I cannot
http://rndnext.blogspot.com/2009/02/jquery-ajax-tooltip.html I want to implement something like the link above. Now this pops up
I am learning OOP with python. I want to implement something like to display:
i want to implement a dynamic relation mechanism with python something like: a:=10 b:=30
for iOS 5.0 using ARC, here is something I want to implement and need

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.