Does "rd.include(request, response);" do anything?

What will really help is to look at the stacktraces produced - then go back to the jasper generated files to get a better idea of narrowing down when the excpetion gets thrown.

-Tim

Abid Ali Teepo wrote:
I don't understand Tim

As far as i can see, i make no call to getOutputStream()

And how come the exact same jsp-page will forward to my "menu.jsp" but not to "safe.html". When i request the latter i get this exception.

Here is my JSP :
<%@ page import="Bid.BidSession"%>
<% BidSession bidSession = BidSession.readParameters(request, "AUTHCLIENT");
RequestDispatcher rd = request.getRequestDispatcher("BidProxy");
rd.include(request, response);
session.setAttribute("bid.authenticated",new String("true"));

String pageWanted = (String)session.getAttribute("bid.pageWanted");
if(pageWanted!=null && !"".equals(pageWanted)) {
System.out.println("PageWanted in netbid_done:" +pageWanted);
rd = request.getRequestDispatcher(pageWanted);
rd.forward(request, response);
} else {
rd = request.getRequestDispatcher("/secure/menu.jsp");
rd.forward(request, response);
}
%>


Could you please pinpoint my error ?

Abid


-----Original Message----- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 11. juli 2003 17:13 To: Tomcat Users List Subject: Re: Exception:getOutputStream() has already been called for this response


You have code which is getting the response's output stream, then NOT using it.


Then your JSP is trying to gett the writer.

You can get one or the other, not both.

-Tim

Abid Ali Teepo wrote:

Hi

Anyone recognize this exception :

org.apache.jasper.JasperException: getOutputStream() has already been called for this response

I get this exception when using requestDispatcher to forward to a
html file. The exact same code works when i forward to a jsp file ??

Here is some code :
pageWanted is "/secure/safe.html"

if(pageWanted!=null && !"".equals(pageWanted)) {
        rd = request.getRequestDispatcher(pageWanted);
        rd.forward(request, response);
        } else {
        rd = request.getRequestDispatcher("/secure/menu.jsp");
        rd.forward(request, response);
   }

Any suggestions ?

Abid



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to