我使用Spring工具来开发我的网站。在此网站上,管理员可以上传图像和其他文件,如PDF和CSV,客户可以稍后下载这些文件。 在使用Spring工具时,我设置了用于上传新图片的目标文件夹静态/ images /,它工作得很好。但是在我的Linux服务器上部署了这个jar之后,Spring boot找不到静态文件夹,所以我使用了我找到的这个函数:How to get spring boot application jar parent folder path dynamically? 此函数将图像保存到classes/static/images文件夹中,该文件夹也是使用.jar创建的。然而,通
我正在学习spring boot vs 2.1.1 我想在模板中显示来自外部文件夹的图像。 tomcat 9中有一个应用程序结构: |-webApp/ws-app // where ws-app is the running app
|
|-webData // where I would like to get the image to display in template 我读了很多5年前的文章,我试着使用它们,但没有成功。就像这个:link 我尝试在application.properties中添加以下代码: spring.resources.static