gpt4 book ai didi

tomcat - 设置 spring boot 以显示图像

转载 作者:行者123 更新时间:2023-11-28 22:17:21 29 4
gpt4 key购买 nike

我有一个休息应用程序,它使用嵌入了 tomcat 的 spring boot 1.4.2

在客户端,用户可以通过网络摄像头拍照并保存到服务器。

在服务器端,我将 img 保存在示例中:/home/test/img/

在我的网络应用程序中,我需要设置什么才能显示图像?

<img src="paul.jpg"/>

最佳答案

需要重新定义spring.resources.static-locations属性,例如:

spring.resources.static-locations=classpath:/static/,file:/home/test/img/

关于tomcat - 设置 spring boot 以显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40554357/

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