Tomcat HTTP 状态 404 - 源服务器未找到目标资源的当前表示...使用 Spring boot 和 Tomcat

问题描述 投票:0回答:0

我使用的是 Spring boot 3.0、Tomcat 10.1 和 Java 19。我的页面是 HTML。用Tomcat运行时,找不到我的页面,如图

enter image description here

这是我的控制器:enter image description here

这是我的 pom.xml

` 4.0.0 org.springframework.boot spring-boot-starter-parent 3.0.0 br.com.schmersal.tabela网站 油烟机 战争 0.0.1-快照 油烟机 模板 de tabela de dados 19 org.springframework.boot 弹簧启动启动器执行器 org.springframework.boot spring-boot-starter-百里香叶 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-devtools 运行 真的 org.springframework.boot 弹簧启动启动器测试 测试 org.springframework.boot spring-boot-starter-tomcat 假如 org.springframework.boot 弹簧启动启动器缓存 org.springframework.boot spring-boot-starter-data-mongodb org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot 弹簧启动器 com.microsoft.sqlserver mssql-jdbc 运行 org.springframework.boot spring-boot-starter-data-rest

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
    
</build>
`

配置中还缺少什么?我已经在控制器中更改了一些东西,我已经查看了 Spring Boot 的属性和首选项。

spring-boot tomcat http-status-code-404
© www.soinside.com 2019 - 2024. All rights reserved.