Package org.springframework.web.servlet.view.freemarker

Examples of org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer


        configurer.enable();
    }

    @Bean
    public FreeMarkerConfigurer freemarkerConfig() throws IOException, TemplateException {
        FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer();
        freeMarkerConfigurer.setConfiguration(new freemarker.template.Configuration() {{
            setTemplateLoader(new MultiTemplateLoader(
                    new TemplateLoader[]{
                            new ClassTemplateLoader(FreeMarkerConfig.class, "/")
                    }
            ));
View Full Code Here


  }
 
  @Bean
  public FreeMarkerConfigurer getFreemarkerConfig() {
   
    FreeMarkerConfigurer result = new FreeMarkerConfigurer();
   
    result.setTemplateLoaderPath("WEB-INF/pages/");
   
    return result;
   
 
View Full Code Here

    };
    accessor = new DirectFieldAccessor(tilesConfigurer);
    assertArrayEquals(definitions, (String[]) accessor.getPropertyValue("definitions"));
    assertTrue((boolean)accessor.getPropertyValue("checkRefresh"));

    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);
View Full Code Here

      registry.freeMarker();
    }

    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer() {
      FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
      configurer.setTemplateLoaderPath("/WEB-INF/");
      return configurer;
    }
View Full Code Here

      return viewResolver;
    }

    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer() {
      FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
      configurer.setTemplateLoaderPath("/WEB-INF/");
      return configurer;
    }
View Full Code Here

        return wroManagerFactory;
    }

    @Bean
    public FreeMarkerConfigurer freemarkerConfig() throws IOException, TemplateException {
        FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer();
        freeMarkerConfigurer.setConfiguration(new freemarker.template.Configuration() {{
            setTemplateLoader(new MultiTemplateLoader(
                    new TemplateLoader[]{
                            new ClassTemplateLoader(FreeMarkerConfig.class, "/"),
                            new WebappTemplateLoader(servletContext, "/")
                    }
View Full Code Here

  public static class FreeMarkerWebConfiguration extends FreeMarkerConfiguration {

    @Bean
    @ConditionalOnMissingBean(FreeMarkerConfig.class)
    public FreeMarkerConfigurer freeMarkerConfigurer() {
      FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
      applyProperties(configurer);
      return configurer;
    }
View Full Code Here

  }

  @Test
  public void renderTemplate() throws Exception {
    registerAndRefreshContext();
    FreeMarkerConfigurer freemarker = this.context
        .getBean(FreeMarkerConfigurer.class);
    StringWriter writer = new StringWriter();
    freemarker.getConfiguration().getTemplate("message.ftl").process(this, writer);
    assertThat(writer.toString(), containsString("Hello World"));
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer

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.