I've realized one problem (and am still looking for a good solution). Let
me explain how a sample JSP flows:
<Database Query is Done>
Things printed to PrintWriter
<Another Database Query is Done>
This printed
...etc
Now my <Database Query Done> tags can do a sendRedirect if there is an
error executing the SQL.
So, say my first database query is done, then things are printed, then the
second query bombs. It will try to do a sendRedirect, which ofcourse won't
work because the servlet output stream has been written to. (Aside note,
this DID work with build 131 - but according to the spec, it probably
shouldn't have).
As I see it, my options are to either:
1) Do all queries at the top of the JSP before any HTML is printed. The way
the JSPs are structured, this would not really be acceptable.
2) Somehow have my "out" PrintWriter really be a buffer. Then, when
everthing is done, print to the real output stream. I'm not sure how
possible this would be....
Any other ideas?
Thanks.
At 09:25 AM 4/29/99 -0400, you wrote:
>I am using the latest JRun build (140) and much of my JSP functionality is
>failing. In many of my JSPs, I do some preliminary processing of a
>request, and if certan conditions are met, I forward the request to another
>JSP for processing.
>
>I do all this BEFORE anything is written to the PrintWriter (Servlet
>OutputSteam). This previously worked w/ build 131, but now doesn't. I've
>tried the RequestDispatcher.forward() also, no luck. In reading the spec,
>it says "You cannot use this method if the PrintWriter object has been
>obtained from the response..."
>
>Well, when JRun compiles a JSP to a JAVA file, one fo the first lines in
>the service() method is:
>
>PrintWriter out = new PrintWriter (new BufferedWriter( new
>OutputStreamWriter(Response.getOutputStream())),true)
>
>How can I get around this? I want to be able to forward requests, but
>cannot because getOutputStream has been called.
>
>Thanks,
>
>Neal Kaiser
>
>------------------------------------------------------------
>To unsubscribe, send email to [EMAIL PROTECTED]
>and include in the body of the message "unsubscribe jrun-development".
>
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html