Hi,
 I have a problem when using request.sendRedirect.....

 The scenario:
-----------------

  I have the example.jsp page with 3 form buttons: text,  image and word.
The form tag is:
         <form name="searchForm" action="example.jsp" method="POST">

  If "text" or "image" button is pressed, then a table or an image is
generated into the jsp page.
  If "word" button is pressed, then I generate a ".word" file (in another
jsp page) and (I want to) prompt the user with a pop up
  window, so he can select open or save the file.

  In the code I check if "word" button was pressed, and if so I do a
request.sendRedirect("/wordGenerator.jsp").
  wordGenerator.jsp writes to the output a stream  the word file contents.

  The problem:
 ------------------

    After submitting "word" button, in "example.jsp" I get the page html
mixed with the result of printing the word file. The reason I found is: "You
also have to call sendRedirect before sending any output whatsoever. Don't
even tempt yourself by acquiring the output stream."
   So I don't know how to solve this problem. Any ideas?


Thanks.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to