2012-04-17 77 views
1

我想要实现总理面临example如何将PrimeFaces示例实现到JSF页面中?

我创造了这个JSF页面:

<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"  
     xmlns:h="http://java.sun.com/jsf/html" 
     xmlns:f="http://java.sun.com/jsf/core" 
     xmlns:ui="http://java.sun.com/jsf/facelets" 
     xmlns:p="http://primefaces.org/ui"> 
    <h:head> 
     <ui:insert name="header">   
      <ui:include src="header.xhtml"/>   
     </ui:insert> 
    </h:head> 
    <h:body> 

     <h1><img src="resources/css/images/icon.png" alt="NVIDIA.com" /> History Center</h1> 
     <!-- layer for black background of the buttons --> 
     <div id="toolbar" style="margin: 0 auto; width:1180px; height:30px; position:relative; background-color:black"> 
      <!-- Include page Navigation --> 
      <ui:insert name="Navigation">   
       <ui:include src="Navigation.xhtml"/>   
      </ui:insert> 

     </div> 

     <div id="greenBand" class="ui-state-default ui-corner-allh" style="position:relative; top:35px; left:0px;"> 
      <h:graphicImage alt="Dashboard" style="position:relative; top:-20px; left:9px;" value="resources/images/logo_application.png" /> 
     </div> 
     <div id="main" style="margin: 0 auto; width:1190px; height:700px; position:absolute; background-color:transparent; top:105px"> 

      <div id="mainpage" style="margin: 0 auto; width:1190px; height:500px; position:absolute; background-color:transparent; top:80px"> 

       <div id="settingsHashMap" style="width:750px; height:400px; position:absolute; background-color:r; top:20px; left:1px"> 

        <p:spinner /> 
        <h:form id="form"> 
         <p:tabView id="tabView" dynamic="true" cache="true"> 

          <p:tab id="tba1" title="Godfather Part I"> 
           <h:panelGrid columns="2" cellpadding="10"> 
            <h:outputText 
             value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. 
             His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T 
             hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, 
             but given to ruthless violence whenever anything stands against the good of the family." /> 
           </h:panelGrid> 
          </p:tab> 

          <p:tab id="tab2" title="Godfather Part II"> 
           <h:panelGrid columns="2" cellpadding="10"> 
            <h:outputText value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream. 
                In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy, 
                killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/> 
           </h:panelGrid> 
          </p:tab> 

          <p:tab id="tab3" title="Godfather Part III"> 
           <h:panelGrid columns="2" cellpadding="10"> 
            <h:outputText value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family. 
                Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/> 
           </h:panelGrid> 
          </p:tab> 

         </p:tabView> 
        </h:form> 


       </div> 


       <div id="settingsdivb" style="width:350px; height:400px; position:absolute; background-color:transparent; top:20px; left:800px"> 


       </div> 



      </div> 
     </div> 

    </h:body> 
</html> 

我不知道为什么,但我只能看到纯文本 - 有没有标签?我错过了什么?

最良好的祝愿

回答

4

如果你还没有真正在你的web应用安装PrimeFaces可能发生。

Download JAR文件,将其放在/WEB-INF/lib文件夹中并重建/重新部署/重新启动。

+0

是的,我还根据这些说明将PrimeFaces添加为依赖项:http://primefaces.org/gettingStarted.html但结果相同。我收到以下消息:警告:此页面调用XML名称空间http://primefaces.org/ui,其前缀为p,但该名称空间不存在标记库 – 2012-04-17 18:46:34

+1

您必须做错了某些事情。此警告表明它仍然不在webapp的运行时类路径中。如上所述,下载JAR并将其放入webapp的'/ WEB-INF/lib'文件夹中。没有其他事情需要去做。 – BalusC 2012-04-17 19:12:46