Beispiel #1
0
 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);
 }
Beispiel #2
0
  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();
  }