gpt4 book ai didi

spring-boot - Spring Boot + Thymeleaf 应用程序中的缓存清除

转载 作者:行者123 更新时间:2023-12-01 11:24:47 25 4
gpt4 key购买 nike

我读了 spring boot documentation似乎如果我使用 Thymeleaf,我只需将以下内容添加到我的 application.properties 文件中即可实现缓存清除:

spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**

但它不起作用!

这是我看到的错误:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ResourceProperties org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.resourceProperties; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.resources.CONFIGURATION_PROPERTIES': Could not bind properties to [unknown] (target=spring.resources, ignoreInvalidFields=false, ignoreUnknownFields=false, ignoreNestedProperties=false); nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'chain[strategy][fixed][version]' of bean class [org.springframework.boot.autoconfigure.web.ResourceProperties]: Cannot access indexed value in property referenced in indexed property path 'chain[strategy][fixed][version]'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'chain[strategy][fixed][version]' of bean class [org.springframework.boot.autoconfigure.web.ResourceProperties]: Bean property 'chain[strategy][fixed][version]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

我错过了什么?

最佳答案

问题出在我使用的 spring boot 版本上。 Spring Boot 1.2 没有任何此类属性,而 1.3 有。

关于spring-boot - Spring Boot + Thymeleaf 应用程序中的缓存清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38477891/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com