作者:
lueichun (no anonymous)
2021-01-01 22:48:04※狀況概述:
我在某個專案內新增一個index.xhtml檔,然後輸入url想要進入該檔案的頁面:
http://localhost:8080/TestJPAProject2/index.jsf
※程式碼:
web.xml長這樣:
<display-name>TestJPAProject2</display-name>
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>