diff options
author | Anna Koskinen <anna@vaadin.com> | 2012-12-18 17:19:36 +0200 |
---|---|---|
committer | Anna Koskinen <anna@vaadin.com> | 2012-12-18 17:19:36 +0200 |
commit | 1da869140d826cd168d64c664b0606df20a9e19a (patch) | |
tree | 9b22ace6f9f675e6bb7ac4ca90011bb792d64d08 /server | |
parent | a6ffd484283353825470988bf2d13093685d2761 (diff) | |
download | vaadin-framework-1da869140d826cd168d64c664b0606df20a9e19a.tar.gz vaadin-framework-1da869140d826cd168d64c664b0606df20a9e19a.zip |
Merge of (#9784) to Vaadin 7.
Extracted static resource response writing to a separate, protected
method.
Change-Id: I5e2b5e86d6aa68e74193aaebb06cef3f9b70151a
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/VaadinServlet.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index b099767b4f..fbb3750b3b 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -878,6 +878,23 @@ public class VaadinServlet extends HttpServlet implements Constants { response.setHeader("Cache-Control", cacheControl); } + writeStaticResourceResponse(request, response, resourceUrl); + } + + /** + * Writes the contents of the given resourceUrl in the response. Can be + * overridden to add/modify response headers and similar. + * + * @param request + * The request for the resource + * @param response + * The response + * @param resourceUrl + * The url to send + * @throws IOException + */ + protected void writeStaticResourceResponse(HttpServletRequest request, + HttpServletResponse response, URL resourceUrl) throws IOException { // Write the resource to the client. final OutputStream os = response.getOutputStream(); final byte buffer[] = new byte[DEFAULT_BUFFER_SIZE]; |