You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Campbell <ch...@lincmedia.co.jp> on 2002/02/26 06:33:06 UTC

RE: java.lang.IllegalStateException: Response has already been co mmitted

Like Ken says, calling the servlet like that will generate a full HTTP
response and close the output stream to the browser. Then your jsp will
continue trying to write to that stream which gives you the error. As long
as the service method of the servlet doesn't close the stream, you might be
able to replace the include for the servlet with:

<%
	new RevGeocodeBlockServlet.service(request, response);
%>

(not sure if the 'new' is necessary)

ChrisC


> -----Original Message-----
> From: Jason Webber [mailto:webber@mminternet.com]
> Sent: Tuesday, February 26, 2002 7:11 AM
> To: tomcat-user@jakarta.apache.org
> Subject: java.lang.IllegalStateException: Response has 
> already been committed 
> 
> 
> I am trying to insert the output of a servlet into cells in a 
> html table.  I
> am getting the above error.  Here is a sample of the code:
> 
> ../servlet/RevGeocodeBlockServlet writes to the outputstream 
> a string which
> represents the location given by the lat and lon specified.
> 
> 
> <html><head><title>Location</title></head><body>
> <table>
> <tr><td>Danny</td><td>
> <jsp:include page="../servlet/RevGeocodeBlockServlet" flush="true">
> 
> <jsp:param name="longitude" value="<%= lon %>"/>
> 
> <jsp:param name="latitude" value="<%= lat %>"/>
> 
> </jsp:include>
> 
> </td></tr>
> 
> <tr><td>Jason</td><td>
> <jsp:include page="../servlet/RevGeocodeBlockServlet" flush="true">
> 
> <jsp:param name="longitude" value="<%= lon %>"/>
> 
> <jsp:param name="latitude" value="<%= lat %>"/>
> 
> </jsp:include>
> 
> </td></tr>
> </table>
> </body></html>
> 
> I don't believe that jsp:include should be doing anything to 
> the headers.
> Is there anything I can do to get around the problem.
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>