gpt4 book ai didi

java - Tomcat - 图像不显示

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

我在部署 tomcat 时遇到问题。

当我尝试输入时

http://localhost:8080/contextpath

我的登录页面的图像根本不显示。

但是,当我输入整个 URL 时

http://localhost:8080/contextpath/Login/login.jsp

我的登录页面的图像能够显示。

已解决

web.xml中有这部分

<welcome-file-list>
<welcome-file>/Login/login.jsp</welcome-file>

最佳答案

在你的代码中试试这个

在部分图像之前放置artifactId

在pom.xml中可以看到artifactId

例子

<img src="/retrytoolweb/logo/LOGOTL-8.svg" width="96" />

希望有所帮助。

关于java - Tomcat - 图像不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37744578/

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