A servlet implements the behaviour of a mail server. One client sends a mail to another (who has an active session with mozilla navigator for example). How can the servlet notify to the user that have new mail:
- with a popup (how)
- changes in his home page (i.e. incoming(1))
Unless the target of the mail message is currently interacting with the server, there is no way to do this.
Otherwise, you can simply modify the logic for the main page of your web app to notify the user that they have new messages. Look at the way that online mail system like Yahoo Mail behave to get an idea of how to make things function.
I suppose that the user is login (It is very possible that is navigator has the home user). The problem is: How the servlet sends to browser an event to refresh incoming mail and to open a new popup?
(I'm using struts)
Thanks a lot
I once implemented a JS solution. It worked, but looked weird (I used hidden frame, so every few seconds the browser would come to live). I'd reccomend using applet, especially when today you have thin SOAP clients you can use in applets.
I agree with David.