我正在Eclipse 4.3上開發一個帶有PrimeFaces 3.5的JSF Web應用程序。沒有編譯時或運行時錯誤,並且應用程序成功部署。但是,我無法在瀏覽器中獲得所需的輸出。 PrimeFaces組件不會顯示,而標準JSF組件則會顯示。PrimeFaces組件不會在瀏覽器中呈現,儘管存在依賴關係
我不確定我是否配置了一切正確。該PrimeFaces JAR至少裏面/WEB-INF/lib
:
而作爲xmlns:p="http:\\primefaces.org\ui"
我映射FacesServlet
上*.xhtml
的PrimeFaces XML命名空間聲明:
下面是login.xhtml
完整的源代碼:
<!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:p=" http://primefaces.org/ui" >
<h:body>
<h:head ><title>Login Page !!</title></h:head>
<h:form>
<p:panel id="panel" header="Login Panel" style="margin-bottom:10px;">
<h:panelGrid columns="3">
<h:outputLabel value="User Id:" />
<p:inputText id="id" value="loginBean.id" required="true" requiredMessage="ID required"/>
<p:message for="id" />
<p:outputLabel value="User Name:" />
<p:inputText id="name" value="loginBean.name" required="true" requiredMessage="Name required" />
<p:message for="name" />
</h:panelGrid>
</p:panel>
<p:commandButton type="Submit" value="Submit" action="#" style="margin-right:20px;" />
`
輸出看起來是這樣的:
正如你看到的,<h:outputText>
做其工作,但沒有<p:xxx>
顯示向上。這是如何造成的,我該如何解決這個問題?
不,它不是呈現一個空白頁。如您所見,該頁面部分呈現。我的猜測是拋出異常,服務器日誌說什麼?此外,編輯您的問題,並用實際代碼替換代碼截圖。 – Magnilex
不發佈圖像的代碼..... –