我收到此错误404:在服务器上运行项目时。
这是针对sts 3.7.3发布的maven m2.i更改了pom.xml中的路径
pom.hml:
<sourceDirectory>src</sourceDirectory>
<outputDirectory>WebContent/WEB-INF/classes</outputDirectory>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
我多次努力解决这个问题。
我目前使用的解决方案是webapp
(或保存视图的文件夹,如jsp)是否在部署程序集中。
试试这个:
右键单击项目> Build Path
> Configure Build path
> Deployment Assembly
> Add
(右侧)> Folder
>(添加你的jsp文件夹,默认情况下是src/main/webapp
)
注意:如果在pages
下有另一个名为webapp
的文件夹,它有jsp文件,比如src/main/webapp/pages
,那么你也必须在构建路径中包含它。