- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Spring boot 中打开证书存储时遇到问题。我的应用程序是一个 war 文件,并且证书存储位于外部路径上。
我得到的错误是:嵌套异常为 java.lang.IllegalStateException:资源 'ServletContext 资源 [/"file:C:/cert/client-keystore.jks"]' 必须位于文件系统上
我将此错误理解为 Spring 尝试打开 ServletContextResource
,而我猜它应该是 FileSystemResource
。如何强制Spring重新分类资源?
文件在那里:
从应用程序属性中读取的路径为:
spring.kafka.producer.ssl.key-store-location="file:C:/cert/client-keystore.jks"
文件读取为:@PropertySource(value = { "file:c:/path/application.properties"})
感谢您的帮助。
巴西、旧金山
最佳答案
将语法更改为以下后,我得到了它的工作:spring.kafka. Producer.ssl.key-store-location=C:/cert/client-keystore.jks
正在从路径中删除文件:。
巴西、旧金山
关于java - 如何在 Spring 中将资源类型从 ServletContextResource 更改为 FileSystemResource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60071550/
我正在使用FileSystemResource和Spring Webflux从硬盘驱动器提供文件。 @GetMapping("/news/file") fun getImage(@RequestPar
我有以下返回文件的 spring mvc 方法: @RequestMapping(value = "/files/{fileName}", method = RequestMethod.GET) pu
我想下载一个文件,同时保留该文件的文件名。 我有: @RequestMapping(value = "/downloadFile", method = RequestMethod.GET,
我尝试从 URL(我的 DropBox 帐户)创建如下所示的 fil,然后将其作为附件添加到 MimeMessageHelper,但我收到 FileNotFoundException。我可能做错了什么
我正在尝试检索类路径中的文件列表,但 Spring 返回的是 FileSystemResources 的 Resource[] 而不是 ClassPathResources。代码如下所示: PathM
是否可以将 MultipartFile 转换为 FileSystemResource? 我有 @RequestParam("file") MultipartFile file 然后 prmPowerP
我需要将我们所有的属性文件存储在一个目录中。此目录的位置应存储在系统环境变量中。在我的应用程序上下文中,我需要访问这个环境变量来创建 FileSystemResource bean。这是我通常拥有的示
我有以下用于下载文件的代码:- @Controller public class FileController { @RequestMapping(value = "/files/{file_
问题: 我创建了一个程序,它将使用 FilesystemResource 从指定路径读取 applicationContext.xml 文件并调用 B.Method。我无法理解为什么我会收到这样的错误
我在 Spring boot 中打开证书存储时遇到问题。我的应用程序是一个 war 文件,并且证书存储位于外部路径上。 我得到的错误是:嵌套异常为 java.lang.IllegalStateExce
我正在使用 Java Mail 发送带有附件的电子邮件。附件不是本地存储在应用程序下,而是从 URL 动态提取。 List fileSystemResources = new ArrayLis
我有一种下载 zip 文件的方法,目前我使用 FileSystemResource 来执行此操作。问题在于扩展 Controller ,我检查文件是否确实是 zip 文件,如果不是,则抛出异常。此异常
我正在尝试使用 Spring MVC 应用程序的基于 Java 的配置从 WEB-INF 读取属性文件。当我将属性目录放在 src 目录中并使用 class: (ClassPathResource)
我是一名优秀的程序员,十分优秀!