接收到“原始服务器未找到目标资源的当前表示,或不愿意透露其存在。”

时间:2018-12-31 02:27:44

标签: jsf java-ee web.xml tomee jsf-2.3

我已经读过this 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>

项目结构

enter image description here

Web Facet

enter image description here

错误

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

0 个答案:

没有答案