ASF Bugzilla – Attachment 23273 Details for
Bug 46727
DefaultServlet - serving multiple encodings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
DefaultServlet refactor - patch
DefaultServlet.patch (text/plain), 5.61 KB, created by
Fred Toth
on 2009-02-17 15:30:12 UTC
(
hide
)
Description:
DefaultServlet refactor - patch
Filename:
MIME Type:
Creator:
Fred Toth
Created:
2009-02-17 15:30:12 UTC
Size:
5.61 KB
patch
obsolete
>--- DefaultServlet-543680.java 2009-02-17 18:23:11.719511000 -0500 >+++ DefaultServlet-refactor.java 2009-02-17 18:24:01.449319000 -0500 >@@ -146,7 +146,7 @@ > * File encoding to be used when reading static files. If none is specified > * the platform default is used. > */ >- protected String fileEncoding = null; >+ protected String fileEncodingParam = null; > > > /** >@@ -235,7 +235,7 @@ > sendfileSize = > Integer.parseInt(getServletConfig().getInitParameter("sendfileSize")) * 1024; > >- fileEncoding = getServletConfig().getInitParameter("fileEncoding"); >+ fileEncodingParam = getServletConfig().getInitParameter("fileEncoding"); > > globalXsltFile = getServletConfig().getInitParameter("globalXsltFile"); > localXsltFile = getServletConfig().getInitParameter("localXsltFile"); >@@ -322,7 +322,7 @@ > throws IOException, ServletException { > > // Serve the requested resource, including the data content >- serveResource(request, response, true); >+ serveResource(request, response, true, fileEncodingParam); > > } > >@@ -341,7 +341,7 @@ > throws IOException, ServletException { > > // Serve the requested resource, without the data content >- serveResource(request, response, false); >+ serveResource(request, response, false, fileEncodingParam); > > } > >@@ -626,7 +626,8 @@ > */ > protected void serveResource(HttpServletRequest request, > HttpServletResponse response, >- boolean content) >+ boolean content, >+ String fileEncodingArg) > throws IOException, ServletException { > > // Identify the requested resource path >@@ -808,7 +809,7 @@ > if (!checkSendfile(request, response, cacheEntry, contentLength, null)) > copy(cacheEntry, renderResult, ostream); > } else { >- copy(cacheEntry, renderResult, writer); >+ copy(cacheEntry, renderResult, writer, fileEncodingArg); > } > } > >@@ -853,7 +854,7 @@ > if (!checkSendfile(request, response, cacheEntry, range.end - range.start + 1, range)) > copy(cacheEntry, ostream, range); > } else { >- copy(cacheEntry, writer, range); >+ copy(cacheEntry, writer, range, fileEncodingArg); > } > } > >@@ -873,7 +874,7 @@ > contentType); > } else { > copy(cacheEntry, writer, ranges.iterator(), >- contentType); >+ contentType, fileEncodingArg); > } > } > >@@ -1733,7 +1734,7 @@ > * > * @exception IOException if an input/output error occurs > */ >- protected void copy(CacheEntry cacheEntry, InputStream is, PrintWriter writer) >+ protected void copy(CacheEntry cacheEntry, InputStream is, PrintWriter writer, String fileEncodingArg) > throws IOException { > > IOException exception = null; >@@ -1746,11 +1747,11 @@ > } > > Reader reader; >- if (fileEncoding == null) { >+ if (fileEncodingArg == null) { > reader = new InputStreamReader(resourceInputStream); > } else { > reader = new InputStreamReader(resourceInputStream, >- fileEncoding); >+ fileEncodingArg); > } > > // Copy the input stream to the output stream >@@ -1808,7 +1809,7 @@ > * @exception IOException if an input/output error occurs > */ > protected void copy(CacheEntry cacheEntry, PrintWriter writer, >- Range range) >+ Range range, String fileEncodingArg) > throws IOException { > > IOException exception = null; >@@ -1816,11 +1817,11 @@ > InputStream resourceInputStream = cacheEntry.resource.streamContent(); > > Reader reader; >- if (fileEncoding == null) { >+ if (fileEncodingArg == null) { > reader = new InputStreamReader(resourceInputStream); > } else { > reader = new InputStreamReader(resourceInputStream, >- fileEncoding); >+ fileEncodingArg); > } > > exception = copyRange(reader, writer, range.start, range.end); >@@ -1900,7 +1901,7 @@ > * @exception IOException if an input/output error occurs > */ > protected void copy(CacheEntry cacheEntry, PrintWriter writer, >- Iterator ranges, String contentType) >+ Iterator ranges, String contentType, String fileEncodingArg) > throws IOException { > > IOException exception = null; >@@ -1910,11 +1911,11 @@ > InputStream resourceInputStream = cacheEntry.resource.streamContent(); > > Reader reader; >- if (fileEncoding == null) { >+ if (fileEncodingArg == null) { > reader = new InputStreamReader(resourceInputStream); > } else { > reader = new InputStreamReader(resourceInputStream, >- fileEncoding); >+ fileEncodingArg); > } > > Range currentRange = (Range) ranges.next();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46727
:
23272
| 23273