Package org.thymeleaf.spring4.context

Examples of org.thymeleaf.spring4.context.SpringWebContext


        processors.add(new SpringActionAttrProcessor());
        processors.add(new SpringHrefAttrProcessor());
        processors.add(new SpringMethodAttrProcessor());
        processors.add(new SpringSrcAttrProcessor());
        processors.add(new SpringValueAttrProcessor());
        processors.add(new SpringObjectAttrProcessor());
        processors.add(new SpringErrorsAttrProcessor());
        processors.addAll(Arrays.asList(SpringInputGeneralFieldAttrProcessor.PROCESSORS));
        processors.add(new SpringInputPasswordFieldAttrProcessor());
        processors.add(new SpringInputCheckboxFieldAttrProcessor());
View Full Code Here




    public SpringResourceTemplateResolver() {
        super();
        this.resourceResolver = new SpringResourceResourceResolver();
        super.setResourceResolver(this.resourceResolver);
    }
View Full Code Here

      return resolver;
    }

    @Bean
    public SpringResourceResourceResolver thymeleafResourceResolver() {
      return new SpringResourceResourceResolver();
    }
View Full Code Here

        String suffix = ".thtml";

        LOG.info( "Registering development Thymeleaf lookup for {} with physical path {}", views.getKey(),
                  views.getValue() );

        TemplateResolver resolver = new SpringResourceTemplateResolver();
        resolver.setOrder( 19 );
        resolver.setCharacterEncoding( "UTF-8" );
        resolver.setTemplateMode( "HTML5" );
        resolver.setCacheable( false );
        resolver.setPrefix( prefix );
        resolver.setSuffix( suffix );

        applicationContext.getAutowireCapableBeanFactory().initializeBean( resolver,
                                                                           "developmentResolver." + views
                                                                               .getKey() );
View Full Code Here

  }

  @Bean
  @Exposed
  public TemplateResolver templateResolver() {
    TemplateResolver resolver = new SpringResourceTemplateResolver();
    resolver.setCharacterEncoding( "UTF-8" );
    resolver.setTemplateMode( "HTML5" );
    resolver.setCacheable( !developmentMode.isActive() );
    resolver.setPrefix( "classpath:/views/" );
    resolver.setSuffix( ".thtml" );
    resolver.setOrder( 20 );

    return resolver;
  }
View Full Code Here

    context.register(ThymeleafAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    MockServletContext servletContext = new MockServletContext();
    context.setServletContext(servletContext);
    context.refresh();
    ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class)
        .resolveViewName("view", Locale.UK);
    MockHttpServletResponse response = new MockHttpServletResponse();
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
    view.render(Collections.singletonMap("foo", "bar"), request, response);
    String result = response.getContentAsString();
    assertTrue("Wrong result: " + result, result.contains("<title>Content</title>"));
    assertTrue("Wrong result: " + result, result.contains("<span>bar</span>"));
    context.close();
  }
View Full Code Here

@Configuration
public class CustomMvcConfig {

    @Bean
    public ThymeleafViewResolver thymeleafViewResolver(SpringTemplateEngine templateEngine) {
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
        viewResolver.setOrder(Ordered.HIGHEST_PRECEDENCE - 10);
        viewResolver.setTemplateEngine(templateEngine);
        return viewResolver;
    }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ThymeleafViewResolver viewResolver(SpringTemplateEngine templateEngine) {
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
        viewResolver.setTemplateEngine(templateEngine);
        viewResolver.setViewClass(ThymeleafTilesView.class);
        return viewResolver;
    }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ViewResolver viewResolver(){
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver() ;
        viewResolver.setTemplateEngine(templateEngine());
        viewResolver.setOrder(1);

        return viewResolver;
    }
View Full Code Here

        return templateEngine;
    }

    @Bean
    public ViewResolver viewResolver(){
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver() ;
        viewResolver.setTemplateEngine(templateEngine());
        viewResolver.setOrder(1);

        return viewResolver;
    }
View Full Code Here

TOP

Related Classes of org.thymeleaf.spring4.context.SpringWebContext

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.