Not able to version static resources with Spring Webflux and Thymeleaf
I try to implement static content versioning on my application using Spring Webflux as described in the documentation: https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/web-reactive.html#webflux-config-static-resources
I have the following resource handler using a version resource resolver:
@Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
final VersionResourceResolver versionResolver = new VersionResourceResolver();
versionResolver.addFixedVersionStrategy("test_version", "/**");
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/")
.resourceChain(false)
.addResolver(versionResolver);
}
With this code, I expect to have all the statics stored into "/static/" in the classpath being requested by the browser with "test_version" added in the URL.
However, of all the resources requested, only a few requests are done with the version in the URL.
For instance, here's a sample of the requested images:
And here is the only image requested with the version added in the URL:
My JS or CSS resources are not versioned two. I don't see any differences at HTTP level (headers, etc.) between a versioned and an unversioned resource, appart from the ETag header.
Here's my project configuration: Spring Boot 2.1.0.RELEASE with Spring Webflux, Thymeleaf 3.0.11.RELEASE, Netty server.
Is there a reason why some of my resources are handled by the VersionResourceResolver, and some are not?
UPDATE
I reproduced the problem on a sample application: https://github.com/adsanche/statics-versioning-problem
This application just contains the Webflux and Thymeleaf started with Spring Boot 2.1.0.RELEASE.
Here's my versioning configuration in application.yml:
spring:
resources:
chain:
strategy:
fixed:
enabled: true
version: test_version
Please note that the image requested through the template is not versioned:
<!-- Can't version this image -->
<img th:src="@{/images/not_versioned.png}">
However, the image requested through the CSS is well versioned:
.test {
background: url('/images/versioned.png');
}
My CSS file requested as through Thymeleaf is not versioned too:
<head>
<link rel="stylesheet" th:href="@{/css/main.css}"/>
</head>
This is the same with Sring Boot 2.1.1.RELEASE.
Am I missing something in my Spring Boot/Thymeleaf configuration, or could it be an issue?
UPDATE 2
I might have some start of explanation concerning this behavior.
The resource invoked through the CSS file seems to be versioned as there is a CssLinkResourceTransformer
that calls the getForUriString
method in the ResourceUrlProvider
, which uses the VersionResourceResolver
to resolve the resource path.
However, when invoked from the template, the SpringWebFluxTemplateEngine
seems to resolve the resource path through a SpringWebFluxLinkBuilder
, whose processLink
method just seems to return the resource path as it is provided, with no transformation or call to the ResourceUrlProvider
.
The only workaround I find at the moment is to override the SpringWebFluxLinkBuilder
this way and setting it to the SpringWebFluxTemplateEngine
:
@Override
public String processLink(IExpressionContext context, String link) {
return super.processLink(context, "test_version" + link);
}
With that code, I am able to version all the CSS/JS/images invoked in the template. However, I'd like to know if this is necessary or if I am just missing some configuration point to trigger this logic automatically.
java spring spring-boot thymeleaf spring-webflux
add a comment |
I try to implement static content versioning on my application using Spring Webflux as described in the documentation: https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/web-reactive.html#webflux-config-static-resources
I have the following resource handler using a version resource resolver:
@Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
final VersionResourceResolver versionResolver = new VersionResourceResolver();
versionResolver.addFixedVersionStrategy("test_version", "/**");
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/")
.resourceChain(false)
.addResolver(versionResolver);
}
With this code, I expect to have all the statics stored into "/static/" in the classpath being requested by the browser with "test_version" added in the URL.
However, of all the resources requested, only a few requests are done with the version in the URL.
For instance, here's a sample of the requested images:
And here is the only image requested with the version added in the URL:
My JS or CSS resources are not versioned two. I don't see any differences at HTTP level (headers, etc.) between a versioned and an unversioned resource, appart from the ETag header.
Here's my project configuration: Spring Boot 2.1.0.RELEASE with Spring Webflux, Thymeleaf 3.0.11.RELEASE, Netty server.
Is there a reason why some of my resources are handled by the VersionResourceResolver, and some are not?
UPDATE
I reproduced the problem on a sample application: https://github.com/adsanche/statics-versioning-problem
This application just contains the Webflux and Thymeleaf started with Spring Boot 2.1.0.RELEASE.
Here's my versioning configuration in application.yml:
spring:
resources:
chain:
strategy:
fixed:
enabled: true
version: test_version
Please note that the image requested through the template is not versioned:
<!-- Can't version this image -->
<img th:src="@{/images/not_versioned.png}">
However, the image requested through the CSS is well versioned:
.test {
background: url('/images/versioned.png');
}
My CSS file requested as through Thymeleaf is not versioned too:
<head>
<link rel="stylesheet" th:href="@{/css/main.css}"/>
</head>
This is the same with Sring Boot 2.1.1.RELEASE.
Am I missing something in my Spring Boot/Thymeleaf configuration, or could it be an issue?
UPDATE 2
I might have some start of explanation concerning this behavior.
The resource invoked through the CSS file seems to be versioned as there is a CssLinkResourceTransformer
that calls the getForUriString
method in the ResourceUrlProvider
, which uses the VersionResourceResolver
to resolve the resource path.
However, when invoked from the template, the SpringWebFluxTemplateEngine
seems to resolve the resource path through a SpringWebFluxLinkBuilder
, whose processLink
method just seems to return the resource path as it is provided, with no transformation or call to the ResourceUrlProvider
.
The only workaround I find at the moment is to override the SpringWebFluxLinkBuilder
this way and setting it to the SpringWebFluxTemplateEngine
:
@Override
public String processLink(IExpressionContext context, String link) {
return super.processLink(context, "test_version" + link);
}
With that code, I am able to version all the CSS/JS/images invoked in the template. However, I'd like to know if this is necessary or if I am just missing some configuration point to trigger this logic automatically.
java spring spring-boot thymeleaf spring-webflux
add a comment |
I try to implement static content versioning on my application using Spring Webflux as described in the documentation: https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/web-reactive.html#webflux-config-static-resources
I have the following resource handler using a version resource resolver:
@Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
final VersionResourceResolver versionResolver = new VersionResourceResolver();
versionResolver.addFixedVersionStrategy("test_version", "/**");
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/")
.resourceChain(false)
.addResolver(versionResolver);
}
With this code, I expect to have all the statics stored into "/static/" in the classpath being requested by the browser with "test_version" added in the URL.
However, of all the resources requested, only a few requests are done with the version in the URL.
For instance, here's a sample of the requested images:
And here is the only image requested with the version added in the URL:
My JS or CSS resources are not versioned two. I don't see any differences at HTTP level (headers, etc.) between a versioned and an unversioned resource, appart from the ETag header.
Here's my project configuration: Spring Boot 2.1.0.RELEASE with Spring Webflux, Thymeleaf 3.0.11.RELEASE, Netty server.
Is there a reason why some of my resources are handled by the VersionResourceResolver, and some are not?
UPDATE
I reproduced the problem on a sample application: https://github.com/adsanche/statics-versioning-problem
This application just contains the Webflux and Thymeleaf started with Spring Boot 2.1.0.RELEASE.
Here's my versioning configuration in application.yml:
spring:
resources:
chain:
strategy:
fixed:
enabled: true
version: test_version
Please note that the image requested through the template is not versioned:
<!-- Can't version this image -->
<img th:src="@{/images/not_versioned.png}">
However, the image requested through the CSS is well versioned:
.test {
background: url('/images/versioned.png');
}
My CSS file requested as through Thymeleaf is not versioned too:
<head>
<link rel="stylesheet" th:href="@{/css/main.css}"/>
</head>
This is the same with Sring Boot 2.1.1.RELEASE.
Am I missing something in my Spring Boot/Thymeleaf configuration, or could it be an issue?
UPDATE 2
I might have some start of explanation concerning this behavior.
The resource invoked through the CSS file seems to be versioned as there is a CssLinkResourceTransformer
that calls the getForUriString
method in the ResourceUrlProvider
, which uses the VersionResourceResolver
to resolve the resource path.
However, when invoked from the template, the SpringWebFluxTemplateEngine
seems to resolve the resource path through a SpringWebFluxLinkBuilder
, whose processLink
method just seems to return the resource path as it is provided, with no transformation or call to the ResourceUrlProvider
.
The only workaround I find at the moment is to override the SpringWebFluxLinkBuilder
this way and setting it to the SpringWebFluxTemplateEngine
:
@Override
public String processLink(IExpressionContext context, String link) {
return super.processLink(context, "test_version" + link);
}
With that code, I am able to version all the CSS/JS/images invoked in the template. However, I'd like to know if this is necessary or if I am just missing some configuration point to trigger this logic automatically.
java spring spring-boot thymeleaf spring-webflux
I try to implement static content versioning on my application using Spring Webflux as described in the documentation: https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/web-reactive.html#webflux-config-static-resources
I have the following resource handler using a version resource resolver:
@Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
final VersionResourceResolver versionResolver = new VersionResourceResolver();
versionResolver.addFixedVersionStrategy("test_version", "/**");
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/")
.resourceChain(false)
.addResolver(versionResolver);
}
With this code, I expect to have all the statics stored into "/static/" in the classpath being requested by the browser with "test_version" added in the URL.
However, of all the resources requested, only a few requests are done with the version in the URL.
For instance, here's a sample of the requested images:
And here is the only image requested with the version added in the URL:
My JS or CSS resources are not versioned two. I don't see any differences at HTTP level (headers, etc.) between a versioned and an unversioned resource, appart from the ETag header.
Here's my project configuration: Spring Boot 2.1.0.RELEASE with Spring Webflux, Thymeleaf 3.0.11.RELEASE, Netty server.
Is there a reason why some of my resources are handled by the VersionResourceResolver, and some are not?
UPDATE
I reproduced the problem on a sample application: https://github.com/adsanche/statics-versioning-problem
This application just contains the Webflux and Thymeleaf started with Spring Boot 2.1.0.RELEASE.
Here's my versioning configuration in application.yml:
spring:
resources:
chain:
strategy:
fixed:
enabled: true
version: test_version
Please note that the image requested through the template is not versioned:
<!-- Can't version this image -->
<img th:src="@{/images/not_versioned.png}">
However, the image requested through the CSS is well versioned:
.test {
background: url('/images/versioned.png');
}
My CSS file requested as through Thymeleaf is not versioned too:
<head>
<link rel="stylesheet" th:href="@{/css/main.css}"/>
</head>
This is the same with Sring Boot 2.1.1.RELEASE.
Am I missing something in my Spring Boot/Thymeleaf configuration, or could it be an issue?
UPDATE 2
I might have some start of explanation concerning this behavior.
The resource invoked through the CSS file seems to be versioned as there is a CssLinkResourceTransformer
that calls the getForUriString
method in the ResourceUrlProvider
, which uses the VersionResourceResolver
to resolve the resource path.
However, when invoked from the template, the SpringWebFluxTemplateEngine
seems to resolve the resource path through a SpringWebFluxLinkBuilder
, whose processLink
method just seems to return the resource path as it is provided, with no transformation or call to the ResourceUrlProvider
.
The only workaround I find at the moment is to override the SpringWebFluxLinkBuilder
this way and setting it to the SpringWebFluxTemplateEngine
:
@Override
public String processLink(IExpressionContext context, String link) {
return super.processLink(context, "test_version" + link);
}
With that code, I am able to version all the CSS/JS/images invoked in the template. However, I'd like to know if this is necessary or if I am just missing some configuration point to trigger this logic automatically.
java spring spring-boot thymeleaf spring-webflux
java spring spring-boot thymeleaf spring-webflux
edited Dec 17 '18 at 16:00
Sancho
asked Dec 14 '18 at 17:31
SanchoSancho
879
879
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
First, you should drop your custom configuration and rely on configuration properties, since you're doing nothing that Spring Boot already achieves:
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.version=test_version
The resource URLs are rewritten on the server side by the resource handling support in Spring Framework.
First, you should make sure that it's enabled:
- In the case of Spring Boot, you should not have a
@EnableWebMvc
or@EnableWebFlux
, since those disable the web auto-configuration - The resource links should be in a template file or in a file that's rewritten by Spring (a CSS file, for example)
- The resources URLs should be encoded by the templating engine, like
<link rel="stylesheet" th:href="@{/static/css/spring.css}">
In the case of Spring WebFlux, resources like CSS files are being rewritten by the resource handler while being served. Rewriting links to resources in templating engines is supported in Spring MVC, but not currently in Spring WebFlux.
You can see that the ResourceUrlProvider
contract is asynchronous, since it returns a Mono
type. On the other hand, the SpringWebFluxLinkBuilder
expects a blocking contract. I'm not saying that Thymeleaf is at fault here, since Thymeleaf is already rendering the template in a reactive fashion. But in order to render those links, we need to potentially read the whole resource and compute its hash - and we can't do that in the middle of rendering the template.
You can read more about this in SPR-15012, which explains the current state of things. Feel free to comment on that ticket - maybe things evolved in the meantime, or something might be missing from the Spring Framework / Spring Boot reference documentations.
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53784406%2fnot-able-to-version-static-resources-with-spring-webflux-and-thymeleaf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
First, you should drop your custom configuration and rely on configuration properties, since you're doing nothing that Spring Boot already achieves:
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.version=test_version
The resource URLs are rewritten on the server side by the resource handling support in Spring Framework.
First, you should make sure that it's enabled:
- In the case of Spring Boot, you should not have a
@EnableWebMvc
or@EnableWebFlux
, since those disable the web auto-configuration - The resource links should be in a template file or in a file that's rewritten by Spring (a CSS file, for example)
- The resources URLs should be encoded by the templating engine, like
<link rel="stylesheet" th:href="@{/static/css/spring.css}">
In the case of Spring WebFlux, resources like CSS files are being rewritten by the resource handler while being served. Rewriting links to resources in templating engines is supported in Spring MVC, but not currently in Spring WebFlux.
You can see that the ResourceUrlProvider
contract is asynchronous, since it returns a Mono
type. On the other hand, the SpringWebFluxLinkBuilder
expects a blocking contract. I'm not saying that Thymeleaf is at fault here, since Thymeleaf is already rendering the template in a reactive fashion. But in order to render those links, we need to potentially read the whole resource and compute its hash - and we can't do that in the middle of rendering the template.
You can read more about this in SPR-15012, which explains the current state of things. Feel free to comment on that ticket - maybe things evolved in the meantime, or something might be missing from the Spring Framework / Spring Boot reference documentations.
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
add a comment |
First, you should drop your custom configuration and rely on configuration properties, since you're doing nothing that Spring Boot already achieves:
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.version=test_version
The resource URLs are rewritten on the server side by the resource handling support in Spring Framework.
First, you should make sure that it's enabled:
- In the case of Spring Boot, you should not have a
@EnableWebMvc
or@EnableWebFlux
, since those disable the web auto-configuration - The resource links should be in a template file or in a file that's rewritten by Spring (a CSS file, for example)
- The resources URLs should be encoded by the templating engine, like
<link rel="stylesheet" th:href="@{/static/css/spring.css}">
In the case of Spring WebFlux, resources like CSS files are being rewritten by the resource handler while being served. Rewriting links to resources in templating engines is supported in Spring MVC, but not currently in Spring WebFlux.
You can see that the ResourceUrlProvider
contract is asynchronous, since it returns a Mono
type. On the other hand, the SpringWebFluxLinkBuilder
expects a blocking contract. I'm not saying that Thymeleaf is at fault here, since Thymeleaf is already rendering the template in a reactive fashion. But in order to render those links, we need to potentially read the whole resource and compute its hash - and we can't do that in the middle of rendering the template.
You can read more about this in SPR-15012, which explains the current state of things. Feel free to comment on that ticket - maybe things evolved in the meantime, or something might be missing from the Spring Framework / Spring Boot reference documentations.
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
add a comment |
First, you should drop your custom configuration and rely on configuration properties, since you're doing nothing that Spring Boot already achieves:
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.version=test_version
The resource URLs are rewritten on the server side by the resource handling support in Spring Framework.
First, you should make sure that it's enabled:
- In the case of Spring Boot, you should not have a
@EnableWebMvc
or@EnableWebFlux
, since those disable the web auto-configuration - The resource links should be in a template file or in a file that's rewritten by Spring (a CSS file, for example)
- The resources URLs should be encoded by the templating engine, like
<link rel="stylesheet" th:href="@{/static/css/spring.css}">
In the case of Spring WebFlux, resources like CSS files are being rewritten by the resource handler while being served. Rewriting links to resources in templating engines is supported in Spring MVC, but not currently in Spring WebFlux.
You can see that the ResourceUrlProvider
contract is asynchronous, since it returns a Mono
type. On the other hand, the SpringWebFluxLinkBuilder
expects a blocking contract. I'm not saying that Thymeleaf is at fault here, since Thymeleaf is already rendering the template in a reactive fashion. But in order to render those links, we need to potentially read the whole resource and compute its hash - and we can't do that in the middle of rendering the template.
You can read more about this in SPR-15012, which explains the current state of things. Feel free to comment on that ticket - maybe things evolved in the meantime, or something might be missing from the Spring Framework / Spring Boot reference documentations.
First, you should drop your custom configuration and rely on configuration properties, since you're doing nothing that Spring Boot already achieves:
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.version=test_version
The resource URLs are rewritten on the server side by the resource handling support in Spring Framework.
First, you should make sure that it's enabled:
- In the case of Spring Boot, you should not have a
@EnableWebMvc
or@EnableWebFlux
, since those disable the web auto-configuration - The resource links should be in a template file or in a file that's rewritten by Spring (a CSS file, for example)
- The resources URLs should be encoded by the templating engine, like
<link rel="stylesheet" th:href="@{/static/css/spring.css}">
In the case of Spring WebFlux, resources like CSS files are being rewritten by the resource handler while being served. Rewriting links to resources in templating engines is supported in Spring MVC, but not currently in Spring WebFlux.
You can see that the ResourceUrlProvider
contract is asynchronous, since it returns a Mono
type. On the other hand, the SpringWebFluxLinkBuilder
expects a blocking contract. I'm not saying that Thymeleaf is at fault here, since Thymeleaf is already rendering the template in a reactive fashion. But in order to render those links, we need to potentially read the whole resource and compute its hash - and we can't do that in the middle of rendering the template.
You can read more about this in SPR-15012, which explains the current state of things. Feel free to comment on that ticket - maybe things evolved in the meantime, or something might be missing from the Spring Framework / Spring Boot reference documentations.
edited Jan 2 at 13:11
answered Dec 17 '18 at 8:18
Brian ClozelBrian Clozel
32.1k779104
32.1k779104
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
add a comment |
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
Brian, I just updated my post with a sample project reproducing my issue: github.com/adsanche/statics-versioning-problem
– Sancho
Dec 17 '18 at 13:18
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
May I have a feedback on my deeper analysis and the problem reproduced on a sample project? I'm wondering about opening an issue about it on Thymeleaf or Spring Boot project.
– Sancho
Dec 31 '18 at 13:12
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I've edited my answer; unfortunately, this is the current state of things. Sorry, my first answer was misleading since I totally forgot about that limitation.
– Brian Clozel
Jan 2 at 13:13
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
I understand, I'll stick to my workaround of overriding the Thymeleaf SpringWebFluxLinkBuilder and rewriting manually the resource URLs of the paths granted in my Spring versioning configuration, it does the job for me. But yes, it would be a nice thing to make it work as transparently as in Spring MVC.
– Sancho
Jan 2 at 16:39
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53784406%2fnot-able-to-version-static-resources-with-spring-webflux-and-thymeleaf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown