0

PrimeFaces で JSF を使用してアプリケーションを開発しました。<p:xxx>タグがページに表示されないFacelets ページに問題があります。これは、ラベル、テキストボックス、およびボタンを表示するための私のFaceletsページです。ページにはラベルのみが表示されます。

<!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://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:i="http://primefaces.prime.com.tr/touch"
      xmlns:p="http://primefaces.org/ui">
<h:head></h:head> 
<body> 
<ui:composition template="/templates/template.xhtml">
    <ui:define name="content">
    <h:form>  

        <h:outputLabel for="curator" value="Name:" style="font-weight:bold"/>  

        <p:inputText id="curator" value="#{user.curator}" />  

        <p:commandButton value="Submit" update="display"/>  
</h:form>  
    </ui:define>
</ui:composition>
</body> 
</html>

私の web.xml ファイル

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>Cation</display-name>

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
      </context-param>
   <welcome-file-list>
        <welcome-file>faces/login.xhtml</welcome-file>
    </welcome-file-list>

     <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>/faces/*</url-pattern>
    </servlet-mapping>
  <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener>
</web-app>

これはどのように発生し、どうすれば解決できますか?

4

1 に答える 1

0

Librariesラベルが表示されているのは、他のタグが p であるのに対し、h タグであるためです。最初に、プロジェクトで (Netbeans を使用している場合) またはeclipseで、primefaces jar が実装されているかどうかを確認してくださいJava Resources\Librariesxmlns:p="http://primefaces.org/ui"は、primefaces を機能させるのに十分ではなく、名前空間を指定するだけです。

:あなたの場合、タグがより関連性がprimefaces-extensionsあると思われる場所にタグを付けています。primefaces

于 2013-06-12T08:52:48.817 に答える