Discussions

Web tier: servlets, JSP, Web frameworks: Notify new events to web client

  1. Notify new events to web client (4 messages)

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

    Thanks

    Threaded Messages (4)

  2. Notify new events to web client[ Go to top ]

    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.
  3. More precision[ Go to top ]

    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?

    Perhaps inverse idea, a javascript function (or and applet, I don't like this idea) that perform a question to servlet every X seconds. This implies a new reload of all page only if has a new mail??.

    (I'm using struts)

    Thanks a lot
  4. More precision[ Go to top ]

    You need to have a clinet side logic. As mention, it can be either JavaScript in a page that gets reloaded every few seconds or applet which communicates with the server.
    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.

    David
  5. More precision[ Go to top ]

    I agree with David.