Package org.apache.velocity

Examples of org.apache.velocity.Template.process()


                resource = new Template();
                resource.setRuntimeServices(rsvc);
                resource.setResourceLoader(this);
                resource.setName(resourceName);
                resource.setEncoding(encoding);
                resource.process();

                templateCache.put(resourceName, resource);
            }

            return resource;
View Full Code Here


                resource = new Template();
                resource.setRuntimeServices(rsvc);
                resource.setResourceLoader(this);
                resource.setName(resourceName);
                resource.setEncoding(encoding);
                resource.process();

                templateCache.put(resourceName, resource);
            }

            return resource;
View Full Code Here

                resource = new Template();
                resource.setRuntimeServices(rsvc);
                resource.setResourceLoader(this);
                resource.setName(resourceName);
                resource.setEncoding(encoding);
                resource.process();

                templateCache.put(resourceName, resource);
            }

            return resource;
View Full Code Here

                resource = new Template();
                resource.setRuntimeServices(rsvc);
                resource.setResourceLoader(this);
                resource.setName(resourceName);
                resource.setEncoding(encoding);
                resource.process();

                templateCache.put(resourceName, resource);
            }

            return resource;
View Full Code Here

  public void renderTemplate() throws Exception {
    registerAndRefreshContext();
    VelocityConfigurer velocity = this.context.getBean(VelocityConfigurer.class);
    StringWriter writer = new StringWriter();
    Template template = velocity.getVelocityEngine().getTemplate("message.vm");
    template.process();
    VelocityContext velocityContext = new VelocityContext();
    velocityContext.put("greeting", "Hello World");
    template.merge(velocityContext, writer);
    assertThat(writer.toString(), containsString("Hello World"));
  }
View Full Code Here

        VelocityAutoConfiguration.class);
    try {
      VelocityEngine velocity = context.getBean(VelocityEngine.class);
      StringWriter writer = new StringWriter();
      Template template = velocity.getTemplate("message.vm");
      template.process();
      VelocityContext velocityContext = new VelocityContext();
      velocityContext.put("greeting", "Hello World");
      template.merge(velocityContext, writer);
      assertThat(writer.toString(), containsString("Hello World"));
    }
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.