Package freemarker.core

Examples of freemarker.core.Environment.process()


            env.process();
          }else {
            Writer tempOutput = new StringWriter(bufferSize);
            Environment env = template.createProcessingEnvironment(rootMap, tempOutput);
            env.getCurrentNamespace().putAll(globalContext);
            env.process();
            globalContext.putAll(env.getCurrentNamespace().toMap());
            globalContext.put(Pipeline.PIPELINE_CONTENT_VAR_NAME, tempOutput.toString());
          }
        }catch(Exception e){
          handleException(e,templateName,isLastTemplate);
View Full Code Here


            Environment env = template.createProcessingEnvironment(context, writer);

            env.setLocale(locale);
            env.setOutputEncoding(outputCharset);

            env.process();
        } catch (freemarker.template.TemplateException e) {
            error(templateName, e);
        } catch (ParseException e) {
            error(templateName, e);
        }
View Full Code Here

            Environment env = template.createProcessingEnvironment(context, writer);

            env.setLocale(locale);
            env.setOutputEncoding(outputCharset);

            env.process();
        } catch (freemarker.template.TemplateException e) {
            error(templateName, e);
        } catch (ParseException e) {
            error(templateName, e);
        }
View Full Code Here

            Environment env = template.createProcessingEnvironment(context, writer);

            env.setLocale(locale);
            env.setOutputEncoding(outputCharset);

            env.process();
        } catch (freemarker.template.TemplateException e) {
            error(templateName, e);
        } catch (ParseException e) {
            error(templateName, e);
        }
View Full Code Here

        // Since the template cache keeps a single instance of a Template that is shared among users,
        // and since that Template instance is immutable, we need to create an Environment instance and
        // use it to process the template with the user's settings.
        Environment env = template.createProcessingEnvironment(context, outWriter);
        applyUserSettings(env, context);
        env.process();
    }
   
    public static void addAllOfbizTransforms(Map context) {
        BeansWrapper wrapper = BeansWrapper.getDefaultInstance();
        TemplateHashModel staticModels = wrapper.getStaticModels();
View Full Code Here

  @Override
  public void render() throws IOException, TemplateException {
    PrintWriter writer = response.getWriter();
    Environment processingEnv = template.createProcessingEnvironment(root, writer);
    processingEnv.setOutputEncoding("UTF-8");
    processingEnv.process();
    writer.flush();

    result.nothing();
  }
View Full Code Here

  @Override
  public String getContent() throws IOException, TemplateException {
    StringWriter writer = new StringWriter();
    Environment processingEnv = template.createProcessingEnvironment(root, writer);
    processingEnv.setOutputEncoding("UTF-8");
    processingEnv.process();
    writer.flush();

    return writer.getBuffer().toString();
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.