2013-06-21 4 views
0

PrimeFaces 쇼케이스 예제를 사용하려고합니다. ElementLayout하지만 레이아웃이 전혀 표시되지 않습니다!primefaces 구성 요소 (P : layout)이 전혀 작동하지 않습니다.

나는 (오른쪽 네임 스페이스, doctype ...)과 같은 문제와 관련된 문제를 이미 보았지만 아무 것도 작동하지 않습니다. 2.0 (제공) 및 primefaces : 3.5

내 layout.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:f="http://java.sun.com/jsf/core" 
xmlns:h="http://java.sun.com/jsf/html" 
xmlns:ui="http://java.sun.com/jsf/facelets" 
xmlns:p="http://primefaces.org/ui"> 

<h:head> 
    <title>Title</title> 
    </h:head> 
    <h:body> 
      <p:layout fullPage="true"> 
     <p:layoutUnit position="north" size="100" header="Top" resizable="true" closable="true" collapsible="true"> 
      <h:outputText value="Top unit content." /> 
      </p:layoutUnit> 

      <p:layoutUnit position="south" size="100" header="Bottom" resizable="true" closable="true" collapsible="true"> 
       <h:outputText value="South unit content." /> 
      </p:layoutUnit> 

     <p:layoutUnit position="west" size="200" header="Left" resizable="true" closable="true" collapsible="true"> 
      <h:form> 
       <!-- ..... --> 
      </h:form> 
     </p:layoutUnit> 

     <p:layoutUnit position="east" size="200" header="Right" resizable="true" closable="true" collapsible="true" effect="drop"> 
      <h:outputText value="Right unit content." /> 
     </p:layoutUnit> 

     <p:layoutUnit position="center"> 
      <ui:insert name="content">Put default content here, if any.</ui:insert> 
     </p:layoutUnit> 
    </p:layout> 
</h:body>   

하고 페이지 내 치어 파일에서

, 내가 JSF-API를 선언했다. xhtml은 다음과 같이 표시됩니다.

<ui:composition template="/templates/layout.xhtml" 
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:p="http://primefaces.org/ui">  
    <ui:define name="content"> 
    <h:form> 
     <p:commandButton value="View" icon="ui-icon-extlink" 
      actionListener="#{dialogBean.viewCars()}" /> 

     <p:commandButton value="Options" icon="ui-icon-extlink" 
      actionListener="#{dialogBean.viewCarsCustomized()}" /> 
    </h:form> 
    </ui:define> 
    </ui:composition> 

저는 primefaces sh에서 모든 종류의 레이아웃을 시도했습니다. owcase 아무도 나를 위해 당신의 도움이

+0

당신이 뭘 하려는지 렌더링되지 않습니다 경우

<welcome-file-list> <welcome-file>faces/index.xhtml</welcome-file> </welcome-file-list> 

을 다음과 같이 web.xml에

<welcome-file-list> 가되어야 하는가? 첫 번째 페이지에 두 번째 페이지를 표시 하시겠습니까? – Akheloes

답변

0

이것은 스타일의 문제에 대한

enter link description here

덕분에 작동하지 않습니다. 다운로드 Primefaces Aristo

에서이 항아리는이 응용 프로그램에서 사용할 수 있는지 확인 을 클래스 경로는 "primefaces.THEME"에 대한 어떤 상황에 PARAM을 지정하지 web.xml 파일 에 대한 변경을한다.

희망이 레이아웃은 JSF에서 렌더링되는 곳

0

비슷한 문제를했다하는 데 도움이됩니다. 해결책은 web.xml에 있습니다. 그냥 index.xhtml, 레이아웃

+0

사실이 아닙니다. Facelet 페이지를 URL로 매핑하는 방법에 따라 다릅니다 ... 귀하의 답변은 web.xml의 컨텍스트에서만 유효합니다. – Kukeltje

+0

이 구성에는 URL 매핑이 없습니다. 나는 여전히 http : // localhost : 8080/MyWebApp를 사용하여 내 응용 프로그램에 액세스합니다. 내 index.xhtml은 WEB-INF/ –

+0

에 직접 배치됩니다. 서블릿의 URL 매핑이 어떻게 이루어지는 지에 따라 다릅니다. – Kukeltje

관련 문제