Package com.github.jknack.handlebars.io

Examples of com.github.jknack.handlebars.io.TemplateLoader


        if (indexHtml == null) {
            WebApp app = (WebApp) WebApp.getApp(request);
            Map<String, List<String>> context = new HashMap<String, List<String>>();
            context.put(PLUGIN_JS_RESOURCES_PARAM, app.getPluginsJsResources());
            context.put(PLUGIN_CSS_RESOURCES_PARAM, app.getPluginsCssResources());
            TemplateLoader templateLoader = new ServletContextTemplateLoader(request.getServletContext(), "/", ".hbs");
            Handlebars handlebars = new Handlebars(templateLoader);
            Template template = handlebars.compile("index");
            indexHtml = template.apply(context);
        }
        return indexHtml;
View Full Code Here


            prefix = views;
        } else {
            prefix = views.endsWith("/") ? views : views + "/";
        }

        handlebars = new Handlebars(new TemplateLoader() {
            @Override
            public TemplateSource sourceAt(final String location) throws IOException {
                // load from the file system
                final String buffer = read(resolve(location));
View Full Code Here

TOP

Related Classes of com.github.jknack.handlebars.io.TemplateLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.