[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

JSP Instant Messenging

Posted on 2003-11-11
9
Medium Priority
?
310 Views
Last Modified: 2010-04-01
Can anybody suggest a way to implement a service where a user post a text message and it appears instantly(not instanly but real time) on the admin( or simply just another user)'s screen automatically. like a chat sesson just that the receiving end user will not be replying. If possible try to be as detail as possible in offering ideas or solutions for I am new to jsp.. (nv done anything in it b4) thanks:> ^_- cheers. Do offer links to tutorials or source code of related topics.
PS: Both receiving n sending users are connectin thru a web broswer. Sort of like a moderator at home receiving comments real time..
0
Comment
Question by:jyhiroko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9721935
If you store a list of all the current sessions (using a session listener to add them into a Hashtable when they are created, and remove them when they are destroyed)

Then you could store an ArrayList of messages inside the session object, and the user could be shown the last n messages that they recieved...

Of course, this is a transient solution, as if the user has simply closed their browser, then they will never recieve the messages

So you will need to store the messages in some permanent format (file or db), and then when the user logs on, or visits a page, check for new messages in the db and return them to the user...

Tim.
0
 

Author Comment

by:jyhiroko
ID: 9721987
Method seems clear but i got no idea how to implement this.. let me try to digest it for a while. Any source to refer to?
0
 

Author Comment

by:jyhiroko
ID: 9722010
Will the message auto pop up on the receiving end automatically  upon submition by the sender?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 9722035
>  Will the message auto pop up on the receiving end automatically  upon submition by the sender?

No, you will either need:

a)  A frame which is constantly refreshing, and shows a popup if a new message has been recieved

or

b)  Only check when the page is loaded, and show a popup then...
0
 

Author Comment

by:jyhiroko
ID: 9722044
The problem is i got a solution for this.. but i need it to be real time. instead of contanst refreshing. Any alternative solutions?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 750 total points
ID: 9722104
JSP and web browsing in general is a "Client Pull" technology...  The server cannot just arbitrarially "push" data to the browser...

Alternative solutions:

Java Applet that checks for new messages every n seconds
   PRO:  less data fetched each time
  CON:  extra level of complexity -- OSX doesn't have LiveConnect for example

I'd do the small (hidden?) frame that checks every 30 seconds or so...
0
 
LVL 1

Expert Comment

by:JNic
ID: 9722110
If you really need real real-time :) I am afraid you need to write an applet.... - Which does not have a lot to do with jsp.
0
 

Author Comment

by:jyhiroko
ID: 9722210
how to do it using applet?
0
 

Author Comment

by:jyhiroko
ID: 9722211
how to do it using applet?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question