Package org.springframework.web.servlet.view.velocity

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


      registry.velocity();
    }

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

@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

                "spring.velocity.");
    }

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

  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

  }

  @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

Related Classes of org.springframework.web.servlet.view.velocity.VelocityConfigurer

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.