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

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

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

@ -122,7 +122,8 @@ public class ThymeleafReactiveAutoConfigurationTests {
@Test @Test
public void overrideFullModeViewNames() throws Exception { 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 ThymeleafReactiveViewResolver views = this.context
.getBean(ThymeleafReactiveViewResolver.class); .getBean(ThymeleafReactiveViewResolver.class);
assertThat(views.getFullModeViewNames()).isEqualTo(new String[] { "foo", "bar" }); assertThat(views.getFullModeViewNames()).isEqualTo(new String[] { "foo", "bar" });
@ -130,10 +131,12 @@ public class ThymeleafReactiveAutoConfigurationTests {
@Test @Test
public void overrideChunkedModeViewNames() throws Exception { 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 ThymeleafReactiveViewResolver views = this.context
.getBean(ThymeleafReactiveViewResolver.class); .getBean(ThymeleafReactiveViewResolver.class);
assertThat(views.getChunkedModeViewNames()).isEqualTo(new String[] { "foo", "bar" }); assertThat(views.getChunkedModeViewNames())
.isEqualTo(new String[] { "foo", "bar" });
} }
@Test @Test

Loading…
Cancel
Save