pull/10554/head
Phillip Webb 7 years ago
parent 250eb67f46
commit 8be7d3cab4

@ -264,8 +264,10 @@ public class ThymeleafAutoConfiguration {
resolver.setResponseMaxChunkSizeBytes(
this.properties.getReactive().getMaxChunkSize());
}
resolver.setFullModeViewNames(this.properties.getReactive().getFullModeViewNames());
resolver.setChunkedModeViewNames(this.properties.getReactive().getChunkedModeViewNames());
resolver.setFullModeViewNames(
this.properties.getReactive().getFullModeViewNames());
resolver.setChunkedModeViewNames(
this.properties.getReactive().getChunkedModeViewNames());
// This resolver acts as a fallback resolver (e.g. like a
// InternalResourceViewResolver) so it needs to have low precedence
resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);

@ -89,7 +89,8 @@ public class ThymeleafProperties {
private String[] viewNames;
/**
* Comma-separated list of view names (patterns allowed) that should be excluded from resolution.
* Comma-separated list of view names (patterns allowed) that should be excluded from
* resolution.
*/
private String[] excludedViewNames;
@ -218,8 +219,8 @@ public class ThymeleafProperties {
public static class Reactive {
/**
* Maximum size of data buffers used for writing to the response, in bytes. Templates will
* execute in CHUNKED mode by default if this is set a value.
* Maximum size of data buffers used for writing to the response, in bytes.
* Templates will execute in CHUNKED mode by default if this is set a value.
*/
private int maxChunkSize;
@ -229,18 +230,17 @@ public class ThymeleafProperties {
private List<MediaType> mediaTypes;
/**
* Comma-separated list of view names (patterns allowed) that should be executed in FULL mode
* even if a max chunk size is set.
* Comma-separated list of view names (patterns allowed) that should be executed
* in FULL mode even if a max chunk size is set.
*/
private String[] fullModeViewNames;
/**
* Comma-separated list of view names (patterns allowed) that should be the only ones executed
* in CHUNKED mode when a max chunk size is set.
* Comma-separated list of view names (patterns allowed) that should be the only
* ones executed in CHUNKED mode when a max chunk size is set.
*/
private String[] chunkedModeViewNames;
public List<MediaType> getMediaTypes() {
return this.mediaTypes;
}

@ -122,7 +122,8 @@ public class ThymeleafReactiveAutoConfigurationTests {
@Test
public void overrideFullModeViewNames() throws Exception {
load(BaseConfiguration.class, "spring.thymeleaf.reactive.fullModeViewNames:foo,bar");
load(BaseConfiguration.class,
"spring.thymeleaf.reactive.fullModeViewNames:foo,bar");
ThymeleafReactiveViewResolver views = this.context
.getBean(ThymeleafReactiveViewResolver.class);
assertThat(views.getFullModeViewNames()).isEqualTo(new String[] { "foo", "bar" });
@ -130,10 +131,12 @@ public class ThymeleafReactiveAutoConfigurationTests {
@Test
public void overrideChunkedModeViewNames() throws Exception {
load(BaseConfiguration.class, "spring.thymeleaf.reactive.chunkedModeViewNames:foo,bar");
load(BaseConfiguration.class,
"spring.thymeleaf.reactive.chunkedModeViewNames:foo,bar");
ThymeleafReactiveViewResolver views = this.context
.getBean(ThymeleafReactiveViewResolver.class);
assertThat(views.getChunkedModeViewNames()).isEqualTo(new String[] { "foo", "bar" });
assertThat(views.getChunkedModeViewNames())
.isEqualTo(new String[] { "foo", "bar" });
}
@Test

Loading…
Cancel
Save