Upgrade Thymeleaf and Spring

pull/152/head
Dave Syer 11 years ago
parent f39b044cf7
commit 322b03779d

@ -16,8 +16,6 @@
package org.springframework.boot.autoconfigure.thymeleaf;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
@ -39,11 +37,10 @@ import org.springframework.core.Ordered;
import org.springframework.core.env.Environment;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;
import org.thymeleaf.TemplateProcessingParameters;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect;
import org.thymeleaf.resourceresolver.IResourceResolver;
import org.thymeleaf.spring3.SpringTemplateEngine;
import org.thymeleaf.spring3.resourceresolver.SpringResourceResourceResolver;
import org.thymeleaf.spring3.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.ITemplateResolver;
import org.thymeleaf.templateresolver.TemplateResolver;
@ -79,25 +76,7 @@ public class ThymeleafAutoConfiguration {
@Bean
public ITemplateResolver defaultTemplateResolver() {
TemplateResolver resolver = new TemplateResolver();
resolver.setResourceResolver(new IResourceResolver() {
@Override
public InputStream getResourceAsStream(
TemplateProcessingParameters templateProcessingParameters,
String resourceName) {
try {
return DefaultTemplateResolverConfiguration.this.resourceLoader
.getResource(resourceName).getInputStream();
}
catch (IOException ex) {
return null;
}
}
@Override
public String getName() {
return "SPRING";
}
});
resolver.setResourceResolver(thymeleafResourceResolver());
resolver.setPrefix(this.environment.getProperty("prefix", DEFAULT_PREFIX));
resolver.setSuffix(this.environment.getProperty("suffix", DEFAULT_SUFFIX));
resolver.setTemplateMode(this.environment.getProperty("mode", "HTML5"));
@ -108,6 +87,11 @@ public class ThymeleafAutoConfiguration {
return resolver;
}
@Bean
protected SpringResourceResourceResolver thymeleafResourceResolver() {
return new SpringResourceResourceResolver();
}
public static boolean templateExists(Environment environment,
ResourceLoader resourceLoader, String view) {
String prefix = environment.getProperty("spring.thymeleaf.prefix",

@ -39,17 +39,18 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ClassUtils;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.config.EnableWebSocket;
import org.springframework.web.socket.server.config.WebSocketConfigurer;
import org.springframework.web.socket.server.config.WebSocketHandlerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.sockjs.transport.handler.DefaultSockJsService;
/**
* Auto configuration for websockets (and sockjs in particular). Users should be able to
* just define beans of type {@link WebSocketHandler}. If <code>spring-websocket</code> is
* detected on the classpath then we add a {@link DefaultSockJsService} and an MVC handler
* mapping to <code>/&lt;beanName&gt;/**</code> for all of the
* <code>WebSocketHandler</code> beans that have a bean name beginning with "/".
* Auto configuration for websocket server (and sockjs in particular). Users should be
* able to just define beans of type {@link WebSocketHandler}. If
* <code>spring-websocket</code> is detected on the classpath then we add a
* {@link DefaultSockJsService} and an MVC handler mapping to
* <code>/&lt;beanName&gt;/**</code> for all of the <code>WebSocketHandler</code> beans
* that have a bean name beginning with "/".
*
* @author Dave Syer
*/

@ -37,7 +37,7 @@
<snakeyaml.version>1.12</snakeyaml.version>
<spock.version>0.7-groovy-2.0</spock.version>
<spring.version>4.0.0.BUILD-SNAPSHOT</spring.version>
<spring-integration.version>2.2.4.RELEASE</spring-integration.version>
<spring-integration.version>2.2.6.RELEASE</spring-integration.version>
<spring-integration-groovydsl.version>1.0.0.M1</spring-integration-groovydsl.version>
<spring-batch.version>2.2.2.RELEASE</spring-batch.version>
<spring-data-jpa.version>1.4.2.RELEASE</spring-data-jpa.version>
@ -46,9 +46,9 @@
<spring-rabbit.version>1.2.0.RELEASE</spring-rabbit.version>
<spring-mobile.version>1.1.0.RELEASE</spring-mobile.version>
<spring-security.version>3.2.0.RC2</spring-security.version>
<thymeleaf.version>2.0.19</thymeleaf.version>
<thymeleaf-extras-springsecurity3.version>2.0.1</thymeleaf-extras-springsecurity3.version>
<thymeleaf-layout-dialect.version>1.1.3</thymeleaf-layout-dialect.version>
<thymeleaf.version>2.1.1.RELEASE</thymeleaf.version>
<thymeleaf-extras-springsecurity3.version>2.1.0.RELEASE</thymeleaf-extras-springsecurity3.version>
<thymeleaf-layout-dialect.version>1.2</thymeleaf-layout-dialect.version>
<tomcat.version>7.0.47</tomcat.version>
<crashub.version>1.3.0-beta11</crashub.version>
<jolokia.version>1.1.5</jolokia.version>

Loading…
Cancel
Save