Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by GarethEvans:
http://wiki.apache.org/struts/OpenWindowFromAction

------------------------------------------------------------------------------
     w = window.open("", "Results", "resizable,height=200,width=200");
     w.document.open();
     w.document.write(s);
-    w.documenmt.close();
+    w.document.close();
  }}}
  
  Imagine generating this in an Action, where the string "These are my results" 
is replaced by a full HTML page (properly escaped of course).  Yes, you could 
generated the response with a JSP, which is what I would recommend.  That might 
be confusing, so let me explain... a JSP does '''NOT''' have to render a 
complete HTML document.  It can instead render just a snippet of HTML, or just 
some Javascript, or just some comma-separated data, there is no limitation.  If 
you are doing AJAX, whatever is most appropriate can be done via JSPs (like XML 
too!).  This saved you from writing a lot of println's in your Actions to 
generate a response.

Reply via email to