title: Dynamically update JSP page via Servlet
body: <p>I am new to web programming with Java. I have a Client/Server written (in Java) and I want updates from the Client to be sent from the Server to a web interface for a user to view. The timing of the updates will be random, but I want to be able to dynamically update a web page with new data without the browser having to refresh.</p>
  
  <p>Hope this makes sense:</p>
  
  <p>I've tried creating a Servlet that Observes (<code>implements Observer</code>) my Server (which <code>extends Observable</code>) for updates (Strings), however I don't know how to dynamically add these to a browser window. I have tried printing directly from the Servlet using <code>PrintWriter out = response.getWriter();</code> in the <code>doGet()</code> method, but <code>response.getWriter()</code> is unavailable in the Servlet's <code>update()</code> method.</p>
  
  <p>My initial thoughts were to use a JSP page (I need to eventually incorporate HTML/CSS) that receives the Observer updates from the <code>Server</code> but I'm not sure.</p>
  
  <p>I've done some research into Comet/PUSH, but I'm not sure if this is what I need - perhaps a bit overkill? Any advice on how to achieve what I'm after would be greatly appreciated.</p>