2014-03-05 39 views
0

我製作了簡單的facelet,但其上的標記未呈現。 來自backing bean的值過期但標記未呈現。 我也使用apache cxf進行web服務。未在WebLogic 10.3.6上呈現的JSF標記

應用服務器:10.3.6的WebLogic

web.xml中:

<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>*.xhtml</url-pattern> 
    </servlet-mapping> 
    <welcome-file-list> 
     <welcome-file>index.xhtml</welcome-file> 
    </welcome-file-list> 

依賴關係:

<dependency> 
     <groupId>com.sun.faces</groupId> 
     <artifactId>jsf-api</artifactId> 
     <version>2.0.0-b13</version> 
     <scope>compile</scope> 
     </dependency> 

    <dependency> 
    <groupId>com.sun.faces</groupId> 
    <artifactId>jsf-impl</artifactId> 
    <version>2.0.0-b13</version> 
    <scope>compile</scope> 
    </dependency> 

    <dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>jstl</artifactId> 
    <version>1.2</version> 
    </dependency> 

    <dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>servlet-api</artifactId> 
    <version>2.5</version> 
    </dependency> 

的Xhtml的facelet:

<?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://xmlns.jcp.org/jsf/html" 
     xmlns:ui="http://xmlns.jcp.org/jsf/facelets" 
     xmlns:f="http://xmlns.jcp.org/jsf/core"> 
<h:head> 
    <title>DIS</title> 
    <h:outputScript library="javascript" name="jquery.js"/> 
    <h:outputScript library="primefaces" name="primefaces.js"/> 
    <h:outputScript library="javax.faces" name="jsf.js"/> 
</h:head> 

<h:body> 
    <h:outputLabel value="#{sessionViewBean.test}"/> 
</h:body> 
</html> 

輸出頁:

<?xml version="1.0" encoding="UTF-8"?> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:f="http://xmlns.jcp.org/jsf/core"> 
<h:head> 
    <title>DIS</title> 
    <h:outputScript library="javascript" name="jquery.js"></h:outputScript> 
    <h:outputScript library="primefaces" name="primefaces.js"></h:outputScript> 
    <h:outputScript library="javax.faces" name="jsf.js"></h:outputScript> 
</h:head> 

<h:body> 
    <h:outputLabel value="lolka"></h:outputLabel> 
</h:body> 
</html> 

回答

0

如果有人有興趣,我找到解決方案,我的錯誤是在xhtml頁面上。 h標籤的xmlns定義是錯誤的xmlns:h="http://xmlns.jcp.org/jsf/html"

的右側是xmlns:h="http://java.sun.com/jsf/html"

+0

它不是「錯誤」,新的法律標準是使用xmlns.jcp.org而java.sun.com是舊的,過時的,主要問題是的WebLogic(Oracle)的不支持java社區。 –