针对maven工程web项目中webapp目录下的HTML文件不能在Tomcat正常访问的问题 ,报404
确认HTML文件是否存在于正确的位置
请确保HTML文件存放在"src/main/webapp"目录下,这是Maven工程web项目中存放Web应用程序资源的标准目录。
检查pom.xml配置是否正确
在Maven工程中,需要在pom.xml文件中包含相关依赖库以及配置项。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>版本号</version>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<targetPath>/</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>