Bug 464377 - don't propagate previous state
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
index 600b65b..4c1900f 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
@@ -176,8 +176,11 @@
 			RequestDispatcher.ERROR_STATUS_CODE,
 			HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 
+		HttpServletResponseWrapper wrapperResponse =
+			new HttpServletResponseWrapperImpl(wrappedResponse);
+
 		ResponseStateHandler responseStateHandler = new ResponseStateHandler(
-			request, response, errorDispatchTargets, DispatcherType.ERROR);
+			request, wrapperResponse, errorDispatchTargets, DispatcherType.ERROR);
 
 		responseStateHandler.processRequest();
 
@@ -238,8 +241,11 @@
 			errorDispatchTargets.getServletRegistration().getName());
 		request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE, status);
 
+		HttpServletResponseWrapper wrapperResponse =
+			new HttpServletResponseWrapperImpl(wrappedResponse);
+
 		ResponseStateHandler responseStateHandler = new ResponseStateHandler(
-			request, response, errorDispatchTargets, DispatcherType.ERROR);
+			request, wrapperResponse, errorDispatchTargets, DispatcherType.ERROR);
 
 		responseStateHandler.processRequest();