Is there any way at the moment using JSP 1.0 to circumvent the known problem of 
redirecting a page (via forward) after some use of the JspWriter is performed. I've 
tried to circumvent this problem by doing the following..I've tried placing all my 
non-JpsWriter invoked code on top, then do a page forward  <jsp:forward 
page="MyJsp.jsp" />. I've also looked at the .java generated which shows no invocation 
of the jspwriter except it's instantiation, there was not out.print before the forward 
call...in both cases, however, I get the error: "cannot forward page when getWriter() 
already invoked."

Description:
The basic flow and interaction of the jsp & beans is such:
- jsp1 is initially invoked by another jsp page (jsp0), and (jsp1) renders the html.

- jsp1 includes another jsp page called jsp2.

- jsp2 has a submit field which allows posting to jsp1 which will allow jsp1 to first 
do some necessary non-html processing via a bean, then optionally render the html 
again or forward to another page. jsp1 sees the post and does some processing via the 
bean; depending on a bean property either it continues on in the same page and renders 
the html, or forwards to another page.

- at the very top (before any html) jsp1 checks for the bean property value. If the 
property is a certain value, it does the page forward. Here's a snippet of jsp1 
starting at the very top the page:

Snippet:
<jsp:useBean id="MyBean" class="com.niku.nitc.frontworks.Class1" scope="session"/><%
try
{
  MyBean.handleRecordRequest (request, response);
}
catch(NITCException e)
{
   throw new ServletException ("Error occured", e);
}

if ( MyBean.recordActionMode() != "recordRefresh" )
{
%>
<jsp:forward page="Jsp3.jsp" />
<%
}
%>

//later....
<%@ include file="Jsp2.jsp"%>

Any help on the above would be greatly appreciated.

Regards,
Manny Sarte

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to