解决此错误404:原始服务器未找到目标资源的当前表示,或者不愿意透露存在该目标资源

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

我收到此错误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>
spring spring-tool-suite
1个回答
0
投票

我多次努力解决这个问题。

我目前使用的解决方案是webapp(或保存视图的文件夹,如jsp)是否在部署程序集中。

试试这个:

右键单击项目> Build Path> Configure Build path> Deployment Assembly> Add(右侧)> Folder>(添加你的jsp文件夹,默认情况下是src/main/webapp

注意:如果在pages下有另一个名为webapp的文件夹,它有jsp文件,比如src/main/webapp/pages,那么你也必须在构建路径中包含它。

© www.soinside.com 2019 - 2024. All rights reserved.