1

我已经阅读了这个 SO question,它建议添加index.html,并且我已经这样做了,除了将它添加到我的<welcome-file-list>. 错误仍然存​​在。

我正在使用 Java EE8(因此 JSF 2.3)、Java 11 运行 TomEE 8.0.0-M1,并且正在通过 Intellij 运行它。

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>

    <servlet>
        <servlet-name>FacesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

项目结构

在此处输入图像描述

网络方面

在此处输入图像描述

错误

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.

我试过的网址

http://localhost:8080
http://localhost:8080/MeetPatient
http://localhost:8080/MeetPatient/web

我应该怎么做才能index.xhtml被发现?

4

0 回答 0