tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Campbell <chris.campb...@lincmedia.co.jp>
Subject RE: java.lang.IllegalStateException: Response has already been co mmitted
Date Tue, 26 Feb 2002 05:33:06 GMT

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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message