2014-11-17 67 views
0

我該如何解決這個錯誤?安裝失敗JavaServer Faces 2.0

Failed while installing JavaServer Faces 2.0. 
'web' : unable to configure web module for JavaServer Faces 

這裏是我的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_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> 
    <display-name>web</display-name> 
    <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>**/faces/*</url-pattern> 
    </servlet-mapping> 
</web-app> 

這裏是我的faces-config.xml中:

<?xml version="1.0" encoding="UTF-8"?> 

<faces-config 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 
    version="2.0"> 

</faces-config> 

這裏是我的pom.xml:

<?xml version="1.0"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 

</project> 

回答

0

使用JSF 2.2引入了新的命名空間 - xmlns.jcp.org取代java.sun.com,看到http://jsflive.wordpress.com/2013/05/16/jsf22-namespaces/

<facelet-taglib version="2.2" 
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-facelettaglibrary_2_2.xsd"> 
</facelet-taglib> 
+0

當我添加的facelet-標籤庫,錯誤是這樣的:CVC-複雜type.2.4.b:元素的含量'facelet-taglib'不完整。其中一個'{「http:// xmlns.jcp.org/xml/ns/javaee":description,」http://xmlns.jcp.org/xml/ns/javaee":display-name,「http: // xmlns.jcp.org/xml/ns/javaee":icon,「http://xmlns.jcp.org/xml/ns/javaee":library-class」,http:// xmlns.jcp。 org/xml/ns/javaee「:namespace}」。 –

+0

你可以發佈你的完整pom嗎? –