简体   繁体   中英

primefaces tag not working in xhtml page

I am developing a jsf web application using primefaces tool for the ui tags. i'm having one problem in primefaces tag which is not working it show an exception like this

/templates/leftmenu.xhtml at line 10 and column 28 <p:tabMenu> Tag Library supports namespace: http://primefaces.org/ui, but no tag was defined for name: tabMenu

my leftmenu xhtml page

<!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:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 
<h:head></h:head> 
<body> 
<h:form>
<p:tabMenu activeIndex="0">
        <p:menuitem value="Home" url="Menu.jsf" icon="ui-icon-star" />
        <p:menuitem value="Fabricants" url="/pagess/pagesFabricant/Fabricant.jsf" icon="ui-icon-wrench"  />  
        <p:menuitem value="Composants" url="/pagess/pagesComposant/Composant.jsf" icon="ui-icon-search"  />  
        <p:menuitem value="Dossier d'equivalence" url="DEQ.jsf" icon="ui-icon-document"  />  
    </p:tabMenu> 
</h:form>
</body> 
</html>

my template xhtml file

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.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:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <link type="text/css" rel="stylesheet" href="theme.css.jsf.css"/>
                <title>Cation</title>
            </f:facet>
        </h:head>

        <h:body>

            <p:layout fullPage="true">

                <p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
                    <p:graphicImage value="/logo.gif" />  
                </p:layoutUnit>

                <p:layoutUnit position="south" size="40" closable="true" collapsible="true">
                    <span style="padding-left: 500px;">Company Name, Copyright 2013</span>
                </p:layoutUnit>

                <p:layoutUnit position="west" size="180" header="Menu" collapsible="true">
                    <ui:insert name="leftmenu">
                        <div>
                            <ui:include src="leftmenu.xhtml" />
                        </div>
                    </ui:insert>
                </p:layoutUnit>

                <p:layoutUnit position="center">
                   <ui:insert name="content">
                        Select one of the links on the left to proceed.
                    </ui:insert>
                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>
</html>

my web.xml file

<?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>
    <listener>
        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>glass-x</param-value>
    </context-param>
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
    </context-param>
    <context-param>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <context-param>
        <description>
    This parameter tells MyFaces if javascript code should be allowed in
    the rendered HTML output.
    If javascript is allowed, command_link anchors will have javascript code
    that submits the corresponding form.
    If javascript is not allowed, the state saving info and nested parameters
    will be added as url parameters.
    Default is 'true'</description>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
    If true, rendered HTML code will be formatted, so that it is 'human-readable'
    i.e. additional line separators and whitespace will be written, that do not
    influence the HTML code.
    Default is 'true'</description>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <description>
    If true, a javascript function will be rendered that is able to restore the
    former vertical scroll on every request. Convenient feature if you have pages
    with long lists and you do not want the browser page to always jump to the top
    if you trigger a link or button action that stays on the same page.
    Default is 'false'
</description>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
        <init-param>
            <param-name>uploadDirectory</param-name>
            <param-value>C:\</param-value>
        </init-param>
        <init-param>
            <param-name>thresholdSize</param-name>
            <param-value>1000000</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <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>
        <url-pattern>*.jsf</url-pattern>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
</web-app>

and i'm using primefaces 3.2 jar file

Can any one help me to solve this problem plz...

tabMenu is not supported in primefaces 3.2 version. Its been supported for version 3.4 and more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM