public DBContextTest(String templateFile) { try { RuntimeSingleton.init(new Properties()); Template template = RuntimeSingleton.getTemplate(templateFile); DBContext dbc = new DBContext(); Hashtable h = new Hashtable(); h.put("Bar", "this is from a hashtable!"); dbc.put("string", "Hello!"); dbc.put("hashtable", h); Writer writer = new BufferedWriter(new OutputStreamWriter(System.out)); template.merge(dbc, writer); writer.flush(); writer.close(); } catch (Exception e) { RuntimeSingleton.error(e); } }
/** * Log an error message. * * @param Object message to log */ public static void error(Object message) { RuntimeSingleton.error(message); }