Dear Sir,

That's right. I am using the <jsp:include> before the redirect. The reason
is that in the include, I need to pass a parameter. Is that a way to pass
the parameter if I were to use the include page directive?

Thanx,
Dinesh, S.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Hans Bergsten
Sent: Monday, August 27, 2001 4:51 PM
To: [EMAIL PROTECTED]
Subject: Re: forward / sendRedirect


Dinesh Somasundram wrote:
>
> Hi All,
>
> I have a page. In the middle of the page, if a certain condition is true,
I
> want to go to a different page. If I use response.sendRedirect(), I keep
> getting "Response has already been committed". If I use jsp:forward I keep
> getting "Cannot forward as OutputStream or Writer has already been
obtained"
>
> Any ideas.... or I just cannot forward to another page from within the
> middle of my JSP. Please kindly advice.

It sounds like you're using <jsp:include> somewhere before forward/redirect.
Due to the fact that the include action flushes the response in JSP 1.1,
you run into these problems. See this article for more details:

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

An alternative may be to use the include *directive* instead of the include
*action*, as described in the article.

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

===========================================================================
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