You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/01/17 16:34:04 UTC

git commit: WICKET-4342 Allow resources disable the flushing of the response after setting the headers

Updated Branches:
  refs/heads/master 16e659316 -> bd11df9eb


WICKET-4342
Allow resources disable the flushing of the response after setting the headers


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/bd11df9e
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/bd11df9e
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/bd11df9e

Branch: refs/heads/master
Commit: bd11df9ebb0671eb831679760aab2ff7371361a9
Parents: 16e6593
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Jan 17 16:34:02 2012 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Jan 17 16:34:02 2012 +0100

----------------------------------------------------------------------
 .../wicket/request/resource/AbstractResource.java  |   17 ++++++++++++--
 1 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/bd11df9e/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java
index daaf541..d0f58b1 100644
--- a/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java
+++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java
@@ -607,13 +607,24 @@ public abstract class AbstractResource implements IResource
 			}
 
 			// 6. Flush the response
-			// This is necessary for firefox if this resource is an image, otherwise it messes up
-			// other images on page
-			webResponse.flush();
+			flushResponseAfterHeaders(webResponse);
 		}
 	}
 
 	/**
+	 * Flushes the response after setting the headers.
+	 * This is necessary for Firefox if this resource is an image,
+	 * otherwise it messes up other images on page.
+	 *
+	 * @param response
+	 *      the current web response
+	 */
+	protected void flushResponseAfterHeaders(final WebResponse response)
+	{
+		response.flush();
+	}
+
+	/**
 	 * Callback invoked when resource data needs to be written to response. Subclass needs to
 	 * implement the {@link #writeData(org.apache.wicket.request.resource.IResource.Attributes)}
 	 * method.