click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r964058 - in /click/trunk/click: examples/src/org/apache/click/examples/page/general/ExcelExportPage.java framework/src/org/apache/click/Partial.java
Date Wed, 14 Jul 2010 14:19:39 GMT
Author: sabob
Date: Wed Jul 14 14:19:39 2010
New Revision: 964058

URL: http://svn.apache.org/viewvc?rev=964058&view=rev
Log:
removed cache header which is specified by Partial

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/general/ExcelExportPage.java
    click/trunk/click/framework/src/org/apache/click/Partial.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/general/ExcelExportPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/general/ExcelExportPage.java?rev=964058&r1=964057&r2=964058&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/general/ExcelExportPage.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/general/ExcelExportPage.java
Wed Jul 14 14:19:39 2010
@@ -80,7 +80,6 @@ public class ExcelExportPage extends Bor
 
         // Set response headers
         response.setHeader("Content-Disposition", "attachment; filename=\"report.xls\"");
-        response.setHeader("Pragma", "no-cache");
 
         try {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();

Modified: click/trunk/click/framework/src/org/apache/click/Partial.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/Partial.java?rev=964058&r1=964057&r2=964058&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/Partial.java (original)
+++ click/trunk/click/framework/src/org/apache/click/Partial.java Wed Jul 14 14:19:39 2010
@@ -491,43 +491,43 @@ public class Partial {
 
         HttpServletResponse response = context.getResponse();
 
-        Reader reader = getReader();
-        InputStream inputStream = getInputStream();
+        Reader localReader = getReader();
+        InputStream localInputStream = getInputStream();
 
         try {
-            String content = getContent();
-            byte[] bytes = getBytes();
+            String localContent = getContent();
+            byte[] localBytes = getBytes();
 
-            String template = getTemplate();
-            if (template != null) {
+            String localTemplate = getTemplate();
+            if (localTemplate != null) {
                 Map<String, Object> templateModel = getModel();
                 if (templateModel == null) {
                     templateModel = new HashMap<String, Object>();
                 }
-                String result = context.renderTemplate(template, templateModel);
-                reader = new StringReader(result);
+                String result = context.renderTemplate(localTemplate, templateModel);
+                localReader = new StringReader(result);
 
-            } else if (content != null) {
-                reader = new StringReader(content);
-            } else if (bytes != null) {
-                inputStream = new ByteArrayInputStream(bytes);
+            } else if (localContent != null) {
+                localReader = new StringReader(localContent);
+            } else if (localBytes != null) {
+                localInputStream = new ByteArrayInputStream(localBytes);
             }
 
-            if (reader != null) {
+            if (localReader != null) {
                 Writer writer = response.getWriter();
                 char[] buffer = new char[WRITER_BUFFER_SIZE];
                 int len = 0;
-                while (-1 != (len = reader.read(buffer))) {
+                while (-1 != (len = localReader.read(buffer))) {
                     writer.write(buffer, 0, len);
                 }
                 writer.flush();
                 writer.close();
 
-            } else if (inputStream != null) {
+            } else if (localInputStream != null) {
                 byte[] buffer = new byte[OUTPUT_BUFFER_SIZE];
                 int len = 0;
                 OutputStream outputStream = response.getOutputStream();
-                while (-1 != (len = inputStream.read(buffer))) {
+                while (-1 != (len = localInputStream.read(buffer))) {
                     outputStream.write(buffer, 0, len);
                 }
                 outputStream.flush();
@@ -538,8 +538,8 @@ public class Partial {
             throw new RuntimeException(e);
 
         } finally {
-            ClickUtils.close(inputStream);
-            ClickUtils.close(reader);
+            ClickUtils.close(localInputStream);
+            ClickUtils.close(localReader);
         }
     }
 
@@ -560,20 +560,20 @@ public class Partial {
             response.setDateHeader("Expires", new Date(1L).getTime());
         }
 
-        String contentType = getContentType();
+        String localContentType = getContentType();
 
         if (getCharacterEncoding() == null) {
 
             // Fallback to request character encoding
             if (context.getRequest().getCharacterEncoding() != null) {
-                response.setContentType(contentType + "; charset="
+                response.setContentType(localContentType + "; charset="
                     + context.getRequest().getCharacterEncoding());
             } else {
-                response.setContentType(contentType);
+                response.setContentType(localContentType);
             }
 
         } else {
-            response.setContentType(contentType + "; charset=" + getCharacterEncoding());
+            response.setContentType(localContentType + "; charset=" + getCharacterEncoding());
         }
     }
 }



Mime
View raw message