public void render() throws IOException { Configuration cfg = new Configuration(Configuration.VERSION_2_3_22); cfg.setDefaultEncoding("UTF-8"); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); cfg.setClassLoaderForTemplateLoading(getClass().getClassLoader(), "/"); renderPersistence(cfg); renderContentProvider(cfg); renderDbHelper(cfg); renderModels(cfg); renderMappers(cfg); }
public Server(int port, String host) throws IOException { this.port = port; this.host = host; Configuration cfg = new Configuration(Configuration.VERSION_2_3_23); cfg.setClassLoaderForTemplateLoading(Server.class.getClassLoader(), "templates"); cfg.setDefaultEncoding("UTF-8"); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER); indexTemplate = cfg.getTemplate("index.html"); messages = new ArrayList<Message>(); serializer = new Persister(); }