2013-07-23 71 views
-1

我的NewFile.xhtml有问题。我使用jsf2.2PrimeFaces不起作用

当我把图书馆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> 
+0

什么? – fvu

+0

不,没有任何错误出现在日志 –

+0

只是:HTTP状态404 - /jsf-blank/NewFile.xhtml,但删除primfaces jar文件时,它将工作! 。 –

回答

0

至于建议就this post,Primefaces 3.5不支持JSF 2.2,从4.0开始支持。 您应该考虑切换到最新的Primefaces版本。

阅读文档了解更多信息:在日志文件中有关Primefaces User's Guide 3.5

+0

太棒了,删除了我的评论 – Kukeltje