Smita wrote:
>
> Hi all,
>          In my applications, when I try to give response.sendRedirect(<fileName>,
> it gives me an error that "Response is already commited". Infact, in this page, I
> am including some of the jsps, wrote earlier. This is case with <@pageforward > tag
> too. What is the reason and remidy for this?

In JSP 1.1, the include action always flushes the response buffer to the browser
before including the specified page. After the buffer has been flushed, you
can't
redirect (since a redirect requires a header to be sent to the browser, and
headers
comes first in the response; hence, it's too late when the buffer has been
flushed).

You can replace the include action with the include directive to avoid this
problem. In JSP 1.2, the include action can be used without flushing.

For more about this, see

  <http://java.oreilly.com/news/jsptips_1100.html>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

===========================================================================
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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to