gpt4 book ai didi

java - tomcat运行但404无错误返回

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

我正在尝试通过 tomcat maven 插件在 tomcat 服务器中运行我的项目。

在我的 pom xml 中:

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

我在 Eclipse 中通过这个命令运行项目:

-e clean tomcat:run

服务器启动时没有错误或警告,但是在将 url 粘贴到网络浏览器的地址栏后发生 404 错误(在 eclipse 控制台中没有错误或警告)。

我该如何解决这个问题?如果您需要更多信息,请在评论中提及。

最佳答案

index 页面不在写入位置,这是 404 未找到错误的原因。请在 /src/main/webappWebContent 文件夹中创建 index.jspindex.html

关于java - tomcat运行但404无错误返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43525801/

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