2017-05-12 8 views
-1

PrimeFaces가 렌더링되지 않습니다. 나는 모든 것을 올바르게 구성했다.PrimeFaces가 내 구성 요소를 완전히 렌더링하지 않습니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:p="http://primefaces.org/ui" 
    xmlns:mp="http://primefaces.org/ui/material"> 
    <head> 
<title>Welcome Page</title> 
    </head> 
    <body> 
     <h:head> 
      <h:form> 
       <h:panelGrid columns="4" cellpadding="5"> 
        <h:outputLabel for="name" value="Name:" style="font-weight:bold" /> 
        <p:inputText id="name" value="#{basicView.text}" /> 
        <p:commandButton value="Submit" update="display" 
         icon="ui-icon-check" /> 
        <h:outputText id="display" value="#{basicView.text}" /> 
       </h:panelGrid> 
      </h:form> 
     </h:head> 
    </body> 
</ui:composition> 
public class BasicView { 

    private String text; 

    public String getText() { 
     return text; 
    } 

    public void setText(String text) { 
     this.text = text; 
    } 
} 

나는 모든 주석과 lib 디렉토리를 포함했다.

Here is the Index.xhtml output

답변

2

당신은 머리와 몸 태그를 엉망. 또한 본문에 양식을 입력해야합니다.

<!DOCTYPE html> 
<h:html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:p="http://primefaces.org/ui" 
    xmlns:mp="http://primefaces.org/ui/material"> 
    <h:head> 
     <title>Welcome Page</title> 
    </h:head> 
    <h:body> 
     <h:form> 
      <h:panelGrid columns="4" cellpadding="5"> 
       <h:outputLabel for="name" value="Name:" style="font-weight:bold" /> 
       <p:inputText id="name" value="#{basicView.text}" /> 
       <p:commandButton value="Submit" update="display" 
        icon="ui-icon-check" /> 
       <h:outputText id="display" value="#{basicView.text}" /> 
      </h:panelGrid> 
     </h:form> 
    </h:body> 
</h:html> 
+1

이런 종류의 xhtml이 만들어 질 때 나는 항상 어떤 튜토리얼이 사용되는지 궁금합니다. 우리는 아무 것도이 오름차순 부지에 들어갈 수 없도록 google로 '제거'를해야합니다. – Kukeltje