please try to use response.reset() before redirection - it works for me. regards, Vitaly Shorin.
----- Original Message ----- From: "Michael Yilma" <[EMAIL PROTECTED]> To: "JRun-Talk" <[EMAIL PROTECTED]> Sent: Monday, December 03, 2001 11:57 PM Subject: RE: getOutputStream throws IllegalStateException > response.getWriter is NOT obtained from the JSP and the servlet. We're simply trying to do response.getOutputStream() .. and it throws an IllegalStateException. The problem occurs only if you have a blank line before <% on the jsp page. Removing the blank line on top of the page would fix the problem but having a <@page import= %> and/or <jsp:useBean> on a new line would also cause the same problem. The only workaround we found is to have all the import and <jsp:useBean>,etc on the same line -- which makes the page almost unreadable. It looks like JRun 3.1 is trying to write out new lines after %>. Other servlet engines do not behave this way. Any other suggestions? > > Thanks. > > > > -----Original Message----- > From: John Zhao <jzhao> > Subject: RE: getOutputStream throws IllegalStateException > Date: 26-Nov-01 10:36 AM > > Hi Corey, > > This is not a bug in JRun 3.1 at all. Please check the Servlet API. You can NOT call both response.getPrinter() and respnse.getOutputStream() at the same time. Otherwise an IllegalStateException should be thrown. JRun 3.0 didn't do that and we corrected the behavior in 3.1. > > Thanks, > John > > -----Original Message----- > From: Corey Benson [mailto:[EMAIL PROTECTED]] > Sent: Saturday, November 24, 2001 10:28 PM > To: JRun-Talk > Subject: getOutputStream throws IllegalStateException > > > Hello, > > We are seeing an IllegalStateException calling the getOutputStream method in JRun 3.1 when this used to work fine using JRun 3.0. Perusing the forums shows that this is a known problem with 3.1 and was supposed to have been fixed with a build newer the 16777. We are using build 17629 and we are still experiencing the same problem. Is this something that is going to be fixed in an upcoming patch? Is there any workaround? > > Here is a simple way to reproduce the problem: > > Create the following servlet - "SimpleServlet" > > public void service( HttpServletRequest req, HttpServletResponse res ) > throws IOException { > ServletOutputStream out = res.getOutputStream(); > out.println("TEST"); > } > > Invoke test servlet from a JSP page or another servlet: > test.jsp: > > <% > pageContext.forward("/servlet/SimpleServlet"); > %> > > When you call "test.jsp", you get the following exception: > > java.lang.IllegalStateException > at allaire.jrun.servlet.JRunResponse.getOutputStream(../servlet/JRunResponse.ja va:294) > at SimpleServlet.service(SimpleServlet.java:36) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1417) > at allaire.jrun.session.JRunSessionService.service(../session/JRunSessionServic e.java:1082) > at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1271) > at allaire.jrun.servlet.JRunNamedDispatcher.forward(../servlet/JRunNamedDispatc her.java:39) > at allaire.jrun.servlet.Invoker.service > > Thanks, > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
