title: Java EE HttpSession communication beetwen jsp and js
body: <p>I want to adding something data in web page dynamically. I have a HttpSessionListener to keep all opened sessions.</p>
  
  <pre><code>public class SessionListener implements HttpSessionListener {
  
  ArrayList&lt;HttpSession&gt; sessions = new ArrayList&lt;HttpSession&gt;();
  
  @Override
  public void sessionCreated( HttpSessionEvent sessionEvent ) {
      sessions.add( sessionEvent.getSession() );
  }
  
  @Override
  public void sessionDestroyed( HttpSessionEvent sessionEvent ) {
      sessions.remove( sessionEvent.getSession() );
  }
  
  public void sendToAll( Info info ) {
      for( HttpSession session: sessions ) {
          //send something to all connection clients.
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And how to get this messages from JavaScript client?</p>