Package freemarker.template

Examples of freemarker.template.TemplateExceptionHandler


    String evalAndCoerceToString(Environment env) throws TemplateException {
        if (dynamicValue == null) {
            return value;
        }
        else {
            TemplateExceptionHandler teh = env.getTemplateExceptionHandler();
            env.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
            try {
               return env.renderElementToString(dynamicValue);
            }
            catch (IOException ioe) {
View Full Code Here


    }

    public void merge(Map<String, Object> context, StringWriter writer) throws TemplateMergeException {
        try {
            template.process(context, writer);
            template.setTemplateExceptionHandler(new TemplateExceptionHandler() {
                @Override
                public void handleTemplateException(TemplateException te, Environment env, Writer out) throws TemplateException {
                    te.printStackTrace();
                }
            });
View Full Code Here

TOP

Related Classes of freemarker.template.TemplateExceptionHandler

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.