From: <bri...@us...> - 2003-07-08 19:48:47
|
Update of /cvsroot/webmacro/webmacro/examples In directory sc8-pr-cvs1:/tmp/cvs-serv7814/examples Modified Files: NoServlet.java Standalone.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: NoServlet.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/examples/NoServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NoServlet.java 4 May 2001 00:39:27 -0000 1.2 --- NoServlet.java 8 Jul 2003 19:48:44 -0000 1.3 *************** *** 40,48 **** Template t = wm.getTemplate("noservlet.wm"); ! // Create FastWriter for fast output encoding ! FastWriter fw = wm.getFastWriter (System.out, "UTF8"); ! // write the template to the output, using our context ! t.write(fw, c); ! fw.close(); ! } } --- 40,44 ---- Template t = wm.getTemplate("noservlet.wm"); ! t.write(System.out, "UTF8", c); ! } } Index: Standalone.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/examples/Standalone.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Standalone.java 4 May 2001 00:39:27 -0000 1.6 --- Standalone.java 8 Jul 2003 19:48:44 -0000 1.7 *************** *** 139,159 **** Template t = _wm.getTemplate("standalone.wm"); - // Create FastWriter for fast output encoding - FastWriter fw = _wm.getFastWriter(resp.getOutputStream(), - resp.getCharacterEncoding()); // write the template to the output, using our context ! t.write(fw, c); ! fw.close(); } catch (org.webmacro.ResourceException e) { ! FastWriter out = _wm.getFastWriter(resp.getOutputStream(), ! resp.getCharacterEncoding()); ! ! out.write("ERROR! Could not locate template standalone.wm, check that your template path is set properly in WebMacro.properties"); ! out.close(); } catch (org.webmacro.ContextException e) { ! FastWriter out = _wm.getFastWriter(resp.getOutputStream(), ! resp.getCharacterEncoding()); ! out.write("ERROR! Could not locate required data in the Context."); ! out.close(); } } catch (java.io.IOException e) { --- 139,148 ---- Template t = _wm.getTemplate("standalone.wm"); // write the template to the output, using our context ! t.write(resp.getOutputStream(), resp.getCharacterEncoding(), c); } catch (org.webmacro.ResourceException e) { ! resp.getWriter().write("ERROR! Could not locate template standalone.wm, check that your template path is set properly in WebMacro.properties"); } catch (org.webmacro.ContextException e) { ! resp.getWriter().write("ERROR! Could not locate required data in the Context."); } } catch (java.io.IOException e) { |