title: Communicating from one jsp to another via servlet
body: <p>I have 2 jsp pages. A main page and a form page. The main page has a grid (extjs framework) and when I click on a row it opens my form jsp page. What I want to achieve is, once the form is submitted, I want my main page to refresh its grid in order to show the new data that was submitted from the form. Note that the form page is a new window. <strong>They both co-exist</strong> in different browser windows (the user sees both at the same time).</p>
  
  <p>One way I thought of doing this is via server sent events. After the form submit, I send an ajax request to the servlet from the form.jsp and it was supposed to respond with an event-stream listened by my main.jsp but it doesn't seem to work. When I try to create the EventSource object it gives me the error:</p>
  
  <p><code>EventSource's response has a MIME type ("text/javascript") that is not "text/event-stream". Aborting the connection.</code></p>
  
  <p>The error seems to appear in my doctype declaration:
  <code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</code></p>
  
  <p>I'm not really sure why this is happening. Any help on that would be appreciated.</p>
  
  <p>Regardless of the method I tried to implement, is there a better way of doing this? Or a fix for the server sent events method?</p>