当前位置: 首页 > 知识库问答 >
问题:

spring boot+Thymeleaf应用程序中的缓存崩溃

盖马鲁
2023-03-14

我阅读了spring boot的文档,看来如果我使用的是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?

我错过了什么?

共有1个答案

钱照
2023-03-14

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

 类似资料:
  • 主要内容:什么是应用程序缓存(Application Cache)?,浏览器支持,HTML5 Cache Manifest 实例,实例,Cache Manifest 基础,Manifest 文件,更新缓存,实例 - 完整的 Manifest 文件,关于应用程序缓存的说明使用 HTML5,通过创建 cache manifest 文件,可以轻松地创建 web 应用的离线版本。 注意:manifest 的技术已被 web 标准废弃,不再推荐使用此功能。 什么是应用程序缓存(Application Ca

  • 使用 HTML5,通过创建 cache manifest 文件,可以轻松地创建 web 应用的离线版本。 什么是应用程序缓存(Application Cache)? HTML5 引入了应用程序缓存,这意味着 web 应用可进行缓存,并可在没有因特网连接时进行访问。 应用程序缓存为应用带来三个优势: 离线浏览 - 用户可在应用离线时使用它们 速度 - 已缓存资源加载得更快 减少服务器负载 - 浏览器

  • 更新我的Android应用程序的www文件夹(使用Cordova 3.6.3)时,该应用程序会显示我的www的旧缓存版本。 如果我清除应用程序数据(来自Android- 当应用程序更新时(或每次应用程序启动时),如何强制应用程序清除缓存?

  • 问题内容: 第一部分 在Grails应用程序中,我了解到您可以通过添加以下方式为每个域类启用二级缓存 默认情况下,仅在调用时使用二级缓存,但也可以通过添加到查询将其用于条件查询和动态查找器。 但是,我仍然不确定我是否了解查询缓存的工作原理。我最好的猜测是: 每个域类都有单独的查询缓存,例如一个用于Book,另一个用于Author 在执行类似的查询之前,将根据域类(Author),查询(findBy

  • 本文向大家介绍SpringBoot中的Thymeleaf用法,包括了SpringBoot中的Thymeleaf用法的使用技巧和注意事项,需要的朋友参考一下 Thymeleaf Thymeleaf是最近SpringBoot推荐支持的模板框架,官网在thymeleaf.org这里。 我们为什么要用Thymeleaf来作为模板引擎呢?官网给了我们一个非常令人信服的解释: Thymeleaf is a m