Announcement Announcement Module
Collapse
No announcement yet.
Broadcast message to all open sessions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Broadcast message to all open sessions

    Hi!

    I have a request for my Tomcat server and a handfull of apps running on it. I would find things much more secure if there was a way of sending a message to all open sessions in every app when I need to stop or restart the server. Say a user could get a page like "Please save your work and exit. Server will stop in 30 seconds"

    Is this at all possible to handle without a JMS server or....? Could perhaps Spring make it easier?

    Thanks in advance!

  • #2
    we gotta be clear here that it is impossible to do it in a push way. Only the pull will work.

    For the pull implementation all of your requests have to be processed thru Spring's web framework. If that is the case then all you need is to implement an interceptor that will palce a flag into a user's session if needed.

    Code:
    session.setAttribute ("saveYourWork",  Boolean.TRUE);
    place the interceptor on all of your execution chains and then on each of the views you would need a statement like this:

    Code:
    <c&#58;if test="$&#123;sessionScope&#91;saveYourWork&#93;&#125;">
    <fmt&#58;message key="save.your.work" />
    </c&#58;if>
    HTH

    Comment


    • #3
      well actually filter instead of interceptor will do a better job here :-)
      and will cover cases where requests are not handled by spring

      Comment


      • #4
        OK, thanks.
        So the other way is to setup a JMS server of some kind and broadcast a http-response through it?

        Comment

        Working...
        X