Examples of VelocityConfigurer


Examples of org.springframework.web.servlet.view.velocity.VelocityConfigurer

    FreeMarkerConfigurer freeMarkerConfigurer = appContext.getBean(FreeMarkerConfigurer.class);
    assertNotNull(freeMarkerConfigurer);
    accessor = new DirectFieldAccessor(freeMarkerConfigurer);
    assertArrayEquals(new String[]{"/", "/test"}, (String[]) accessor.getPropertyValue("templateLoaderPaths"));

    VelocityConfigurer velocityConfigurer = appContext.getBean(VelocityConfigurer.class);
    assertNotNull(velocityConfigurer);
    accessor = new DirectFieldAccessor(velocityConfigurer);
    assertEquals("/test", accessor.getPropertyValue("resourceLoaderPath"));

    GroovyMarkupConfigurer groovyMarkupConfigurer = appContext.getBean(GroovyMarkupConfigurer.class);
View Full Code Here

Examples of org.springframework.web.servlet.view.velocity.VelocityConfigurer

      registry.velocity();
    }

    @Bean
    public VelocityConfigurer velocityConfigurer() {
      VelocityConfigurer configurer = new VelocityConfigurer();
      configurer.setResourceLoaderPath("/WEB-INF/");
      return configurer;
    }
View Full Code Here

Examples of org.springframework.web.servlet.view.velocity.VelocityConfigurer

@ComponentScan(basePackages ="com.kpfu.itis.controller")
public class WebConfig extends WebMvcConfigurerAdapter{

    @Bean
    public VelocityConfigurer velocityConfigurer() {
        VelocityConfigurer velocityConfigurer = new VelocityConfigurer();
        velocityConfigurer.setResourceLoaderPath("WEB-INF/velocity/");
        return velocityConfigurer;
    }
View Full Code Here

Examples of org.springframework.web.servlet.view.velocity.VelocityConfigurer

                "spring.velocity.");
    }

    @Bean
    VelocityConfigurer velocityConfig() {
        return new VelocityConfigurer();
    }
View Full Code Here

Examples of org.springframework.web.servlet.view.velocity.VelocityConfigurer

  public static class VelocityWebConfiguration extends VelocityConfiguration {

    @Bean
    @ConditionalOnMissingBean(VelocityConfig.class)
    public VelocityConfigurer velocityConfigurer() {
      VelocityConfigurer configurer = new VelocityConfigurer();
      applyProperties(configurer);
      return configurer;
    }
View Full Code Here

Examples of org.springframework.web.servlet.view.velocity.VelocityConfigurer

  }

  @Test
  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
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.