1

Eclipse で動的 Web プロジェクトを作成し、(maven を使用する代わりに) JSF jar を lib に手動で追加しました。Faces サーブレット構成を web.xml で提供しました。

webinf フォルダーに配置されたファイルの hello.xhtml 出力を表示しようとしています。しかし、それは投げています:

/hello.xhtml Resource として ExternalContext に見つかりません

私のディレクトリ構造は次のとおりです。

LibraryPro
  Java resoures
    Webcontent
      WEB-INF
         lib
         application.xml
      hello.xhtml 

私が使用しているURLは、

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
    id="WebApp_ID" version="3.0">

  <display-name>JavaServerFaces</display-name>

  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
  </context-param>

  <!-- Welcome page -->
  <welcome-file-list>
    <welcome-file>hello.xhtml</welcome-file>
  </welcome-file-list>

  <!-- JSF mapping -->
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <!-- Map these files with JSF -->
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>

</web-app>
4

0 に答える 0