Commits

Anonymous committed b51b9e4

WW-443 : making WebWorkVelocityServlet flush the writer in mergeTemplate

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@316573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits c668d07

Comments (0)

Files changed (1)

src/java/com/opensymphony/webwork/views/velocity/WebWorkVelocityServlet.java

  * @version $Revision$
  */
 public class WebWorkVelocityServlet extends VelocityServlet {
-    //~ Static fields/initializers /////////////////////////////////////////////
-
     //~ Instance fields ////////////////////////////////////////////////////////
 
     private VelocityManager velocityManager;
         return getTemplate(servletPath, getEncoding());
     }
 
-    private String getEncoding()
-    {
-        // todo look into converting this to using XWork/WebWork2 encoding rules
-        try {
-            return Configuration.getString("webwork.i18n.encoding");
-        } catch (IllegalArgumentException e) {
-            return RuntimeSingleton.getString(RuntimeSingleton.OUTPUT_ENCODING, DEFAULT_OUTPUT_ENCODING);
-        }
-    }
-
     /**
      * This method extends the VelocityServlet's loadConfiguration method by performing the following actions:
      * <ul>
         try {
             Writer writer = pageContext.getOut();
             template.merge(context, writer);
+            writer.flush();
         } finally {
             // perform cleanup
             jspFactory.releasePageContext(pageContext);
             actionContext.put(ServletActionContext.PAGE_CONTEXT, oldPageContext);
         }
     }
+
+    private String getEncoding() {
+        // todo look into converting this to using XWork/WebWork2 encoding rules
+        try {
+            return Configuration.getString("webwork.i18n.encoding");
+        } catch (IllegalArgumentException e) {
+            return RuntimeSingleton.getString(RuntimeSingleton.OUTPUT_ENCODING, DEFAULT_OUTPUT_ENCODING);
+        }
+    }
 }