Has no one seen a problem like this before? I find that strange. In short, after wrapping a response object to write output to a file, I am unable to do a RequestDispatcher forward or a response.sendRedirect() because the response object has been commmitted.
Tomcat and Resin handle this differently. Anyone? > -----Original Message----- > From: Jay Wright [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 01, 2001 12:00 PM > To: [EMAIL PROTECTED] > Subject: error with wrapped response object > > > Hi all, > > I am getting a servlet error which has something to do with a wrapped > response object. > > With Resin, I have created a servlet that wraps a response > object for the > purpose of writing the response's html to a file. This complete > successfully, then the RequestDispatcher forwards the request > to a jsp, > which in effect displays a thank you page. It works wonderfully. > > When I deploy the same application to Tomcat, I get the > following error: > > java.lang.IllegalStateException: Cannot forward after > response has been > committed > at > org.apache.catalina.core.ApplicationDispatcher.doForward(Unknown > Source) > at > org.apache.catalina.core.ApplicationDispatcher.forward(Unknown > Source) > at atonce.mas.web.MainServlet.doGet(MainServlet.java:88) > > Apparently the two servlet containers handle this > differently. As curious > as this is, I'm more concerned with getting the tomcat > version working. Is > there anything I can do to "uncommit" the response? I assume > not. I could > use a sendRedirect, but would prefer to stick with the > RequestDispatchers > forward method to be consistent and standard with my servlet model. > > Any ideas? > > Thanks, > Jay > > ______________________________________________________________ > _____________ > 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 ___________________________________________________________________________ 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
