我的NewFile.xhtml有問題。我使用jsf2.2。PrimeFaces不起作用
當我把圖書館primefaces-3.5.jar放入我的web/lib文件夾並重新啓動tomcat服務器時,網頁不再工作。當我刪除我的PrimeFaces jar文件時,每件事情都能正常工作,而不會顯示我的PrimeFaces標籤。
我把正確的外部JAR,但我覺得有些不妥:
我的web.xml文件
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Sample JSF 2 Filter login app</display-name>
<!-- Login filter -->
<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>somePackage.LoginFilter</filter-class>
</filter>
<!-- Set the login filter to secure all the pages in the /secured/* path of the application -->
<!-- Staring JSF -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- JSF URL mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- By default go to secured welcome page -->
<welcome-file-list>
<welcome-file>NewFile.xhtml</welcome-file>
</welcome-file-list>
</web-app>
我NewFile.xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h1>Hello World PrimeFaces</h1>
<h:form>
<p:editor value="#{editor.value}" />
</h:form>
</h:body>
</html>
什麼? – fvu
不,沒有任何錯誤出現在日誌 –
只是:HTTP狀態404 - /jsf-blank/NewFile.xhtml,但刪除primfaces jar文件時,它將工作! 。 –