Skip to content

Commit 322b037

Browse files
author
Dave Syer
committed
Upgrade Thymeleaf and Spring
1 parent f39b044 commit 322b037

File tree

3 files changed

+20
-35
lines changed

3 files changed

+20
-35
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java

+7-23
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.boot.autoconfigure.thymeleaf;
1818

19-
import java.io.IOException;
20-
import java.io.InputStream;
2119
import java.util.Collection;
2220
import java.util.Collections;
2321

@@ -39,11 +37,10 @@
3937
import org.springframework.core.env.Environment;
4038
import org.springframework.core.io.DefaultResourceLoader;
4139
import org.springframework.core.io.ResourceLoader;
42-
import org.thymeleaf.TemplateProcessingParameters;
4340
import org.thymeleaf.dialect.IDialect;
4441
import org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect;
45-
import org.thymeleaf.resourceresolver.IResourceResolver;
4642
import org.thymeleaf.spring3.SpringTemplateEngine;
43+
import org.thymeleaf.spring3.resourceresolver.SpringResourceResourceResolver;
4744
import org.thymeleaf.spring3.view.ThymeleafViewResolver;
4845
import org.thymeleaf.templateresolver.ITemplateResolver;
4946
import org.thymeleaf.templateresolver.TemplateResolver;
@@ -79,25 +76,7 @@ public void setEnvironment(Environment environment) {
7976
@Bean
8077
public ITemplateResolver defaultTemplateResolver() {
8178
TemplateResolver resolver = new TemplateResolver();
82-
resolver.setResourceResolver(new IResourceResolver() {
83-
@Override
84-
public InputStream getResourceAsStream(
85-
TemplateProcessingParameters templateProcessingParameters,
86-
String resourceName) {
87-
try {
88-
return DefaultTemplateResolverConfiguration.this.resourceLoader
89-
.getResource(resourceName).getInputStream();
90-
}
91-
catch (IOException ex) {
92-
return null;
93-
}
94-
}
95-
96-
@Override
97-
public String getName() {
98-
return "SPRING";
99-
}
100-
});
79+
resolver.setResourceResolver(thymeleafResourceResolver());
10180
resolver.setPrefix(this.environment.getProperty("prefix", DEFAULT_PREFIX));
10281
resolver.setSuffix(this.environment.getProperty("suffix", DEFAULT_SUFFIX));
10382
resolver.setTemplateMode(this.environment.getProperty("mode", "HTML5"));
@@ -108,6 +87,11 @@ public String getName() {
10887
return resolver;
10988
}
11089

90+
@Bean
91+
protected SpringResourceResourceResolver thymeleafResourceResolver() {
92+
return new SpringResourceResourceResolver();
93+
}
94+
11195
public static boolean templateExists(Environment environment,
11296
ResourceLoader resourceLoader, String view) {
11397
String prefix = environment.getProperty("spring.thymeleaf.prefix",

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,18 @@
3939
import org.springframework.context.annotation.Configuration;
4040
import org.springframework.util.ClassUtils;
4141
import org.springframework.web.socket.WebSocketHandler;
42-
import org.springframework.web.socket.server.config.EnableWebSocket;
43-
import org.springframework.web.socket.server.config.WebSocketConfigurer;
44-
import org.springframework.web.socket.server.config.WebSocketHandlerRegistry;
42+
import org.springframework.web.socket.config.annotation.EnableWebSocket;
43+
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
44+
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
4545
import org.springframework.web.socket.sockjs.transport.handler.DefaultSockJsService;
4646

4747
/**
48-
* Auto configuration for websockets (and sockjs in particular). Users should be able to
49-
* just define beans of type {@link WebSocketHandler}. If <code>spring-websocket</code> is
50-
* detected on the classpath then we add a {@link DefaultSockJsService} and an MVC handler
51-
* mapping to <code>/&lt;beanName&gt;/**</code> for all of the
52-
* <code>WebSocketHandler</code> beans that have a bean name beginning with "/".
48+
* Auto configuration for websocket server (and sockjs in particular). Users should be
49+
* able to just define beans of type {@link WebSocketHandler}. If
50+
* <code>spring-websocket</code> is detected on the classpath then we add a
51+
* {@link DefaultSockJsService} and an MVC handler mapping to
52+
* <code>/&lt;beanName&gt;/**</code> for all of the <code>WebSocketHandler</code> beans
53+
* that have a bean name beginning with "/".
5354
*
5455
* @author Dave Syer
5556
*/

spring-boot-dependencies/pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<snakeyaml.version>1.12</snakeyaml.version>
3838
<spock.version>0.7-groovy-2.0</spock.version>
3939
<spring.version>4.0.0.BUILD-SNAPSHOT</spring.version>
40-
<spring-integration.version>2.2.4.RELEASE</spring-integration.version>
40+
<spring-integration.version>2.2.6.RELEASE</spring-integration.version>
4141
<spring-integration-groovydsl.version>1.0.0.M1</spring-integration-groovydsl.version>
4242
<spring-batch.version>2.2.2.RELEASE</spring-batch.version>
4343
<spring-data-jpa.version>1.4.2.RELEASE</spring-data-jpa.version>
@@ -46,9 +46,9 @@
4646
<spring-rabbit.version>1.2.0.RELEASE</spring-rabbit.version>
4747
<spring-mobile.version>1.1.0.RELEASE</spring-mobile.version>
4848
<spring-security.version>3.2.0.RC2</spring-security.version>
49-
<thymeleaf.version>2.0.19</thymeleaf.version>
50-
<thymeleaf-extras-springsecurity3.version>2.0.1</thymeleaf-extras-springsecurity3.version>
51-
<thymeleaf-layout-dialect.version>1.1.3</thymeleaf-layout-dialect.version>
49+
<thymeleaf.version>2.1.1.RELEASE</thymeleaf.version>
50+
<thymeleaf-extras-springsecurity3.version>2.1.0.RELEASE</thymeleaf-extras-springsecurity3.version>
51+
<thymeleaf-layout-dialect.version>1.2</thymeleaf-layout-dialect.version>
5252
<tomcat.version>7.0.47</tomcat.version>
5353
<crashub.version>1.3.0-beta11</crashub.version>
5454
<jolokia.version>1.1.5</jolokia.version>

0 commit comments

Comments
 (0)