【问题标题】:Tomcat error 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.'Tomcat 错误“源服务器没有找到目标资源的当前表示或不愿意透露存在的表示。”
【发布时间】:2019-10-14 18:57:27
【问题描述】:

我正在创建一个 web 应用程序,但在尝试运行“http://localhost:8080/”时出现错误

HTTP Status 404 – Not Found
Type Status Report

Message Not found

Description The origin server did not find a current representation for 
the target resource or is not willing to disclose that one exists.

Apache Tomcat/9.0.20

web.xml

<?xml version="1.0" encoding="UTF-8"?>

 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     id="WebApp_ID" version="3.1"
 >

<!-- Invoke 'Generate' action to add tags or functions -->

<servlet>
    <servlet-name>searchServlet</servlet-name>
    <servlet-class>com.incidents.cashout.CurlExecutor</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>searchServlet</servlet-name>
    <url-pattern>/servlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>getInputs.html</welcome-file>
</welcome-file-list>

Folder Structure

我尝试使用其他解决方案,但它们似乎都不起作用。任何帮助将不胜感激

【问题讨论】:

    标签: maven tomcat web-applications error-handling


    【解决方案1】:

    尝试将 index.jsp 直接放在 webapp 文件夹下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-27
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 2018-04-07
      • 1970-01-01
      相关资源
      最近更新 更多