使用primefaces时发出警告(未找到taglib)

时间:2015-01-26 11:17:52

标签: jsf-2 primefaces

我在项目中使用pimefaces,当页面显示在浏览器中时,我收到以下消息:

Warning: This page calls for XML namespace http://primefaces.org/ui declared with prefix p but no taglibrary exists for that namespace. 

在我的POM中:

<repositories>
    <repository>
        <id>prime-repo</id>
        <name>PrimeFaces Maven Repository</name>
        <url>http://repository.primefaces.org</url>
        <layout>default</layout>
    </repository>
</repositories>

    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>3.5</version>
    </dependency>

在我的xhtml文件中:

<?xml version="1.0" encoding="UTF-8"?>
<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"
    template="/WEB-INF/templates/default_template.xhtml">
    <ui:define name="content">
        <h1>My Stuff</h1>

        <h:form>
            <p:dataTable value="#{edb.actions}" var="action">
                <p:column>
                    <p:commandButton actionListener="#{acontroller.doDelete(aktion)}" icon="ui-icon-close" />
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="name" />
                    </f:facet>
                    <h:outputText value="#{action.name}" />
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="goal" />
                    </f:facet>
                    <h:outputText value="#{action.goals}">
                        <f:convertNumber type="currency" currencyCode="EUR" />
                    </h:outputText>
                </p:column>

..等等

我正在使用Glassfish 4.0和EclipseEE版本:4.3.2。

我需要改变什么?

感谢您的帮助和提示!

编辑:

我完全删除了primefaces,现在没有显示JSF标签。我读到这可能与Faces Servlet没有关联。我的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"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
     xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <display-name>MyProject</display-name>
    <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>*.xhtml</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>

</web-app>

我的webapp文件夹结构:

webapp
- content
--- .xhtml files
- index.xhtml
- resources
--- css
------ screen.css
- WEB-INF
- web.xml
- beans.xml (empty)
- faces.config.xml (empty)
- glassfish.web.xml (empty)
- templates
--- default_template.xhtml

在我的POM中:

<dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.faces</artifactId>
            <version>2.2.8</version>
        </dependency>

        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>javax.faces-api</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency>

......等等:

现在有什么问题?我不明白这一点。它在几天前完美地工作......

0 个答案:

没有答案