Solved

JSP Instant Messenging

Posted on 2003-11-11
9
301 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
  • 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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 250 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now