Gorazd Bozic wrote:
>
> In message <[EMAIL PROTECTED]>, Stephen R writes:
> > I get the following error when I try to forward to a JSP ...
> > java.lang.IllegalStateException: Cannot forward as OutputStream or Writer has
> > already been obtained
>
> >From the Sun's "JavaServer Pages Specification", page 68:
>   If the page output is buffered then the buffer is cleared prior to
>   forwarding.

The page is buffered, so why wasn't it cleared before I tried to forward? I also
tried out.close(), but this didn't work.

>   If the page buffer was unbuffered and anything has been written to it,
>   an attempt to forward the request will result in an IllegalStateException.
>
> > Here's the piece of code ....
> >
> > if ( formName.equals("updatePDForm") ) { %>
> >    <jsp:include page='performUpdatePD.jsp' flush='true'>
> >         <jsp:param name='userid' value='<%= request.getParameter("userid") %>
> > '/>
> >    </jsp:include>
> >
> >    <jsp:forward page='/SubscriberProfile.jsp'>
> >         <jsp:param name='userid' value='<%= request.getParameter("userid") %>
> > '/>
> >    </jsp:forward>
> > <% } %>
>
> Can't you move the include statement to the SubscriberProfile.jsp?

That's what I had to do in the end :-)

Thanks,

Stephen.
> Cheers,
> Gorazd
>
> --
> Gorazd Bozic <[EMAIL PROTECTED]>
> ARNES SI-CERT, Jamova 39 p.p. 7, SI-1001 Ljubljana, Slovenia
> tel: +386 1 479 88 22, fax: +386 1 479 88 99
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> 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

--
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
 Stephen Redmond                        Logica (Mobile Networks)
 Tel:   +353-1-8193673                  5 Custom House Plaza,
 Fax:   +353-1-8193401                  Harbourmaster Place,
 mailto:[EMAIL PROTECTED]             Dublin 1,
 http://www.logica.com/telecoms         Ireland.
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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