我在Eclipse Kepler中使用GlassFish 4。將PrimeFaces 4添加到Java EE項目
我想添加PrimeFaces到我的JSF項目,但我似乎無法導入它。我不斷收到此錯誤:
Warning: This page calls for XML namespace http://primefaces.org/ui declared with prefix p but no taglibrary exists for that namespace
我進口PrimeFaces 4罐和重建(使用我的講師提供一個Ant構建),並重新部署這令我感到困惑。
這裏是我的Ant構建 -
<project name="JavaEE Build" default="BuildAll">
<!-- This needs to be changed before you build your code -->
<property name="glassfish_libs" value="C:\glassfish4\glassfish\modules"/>
<property name="bin" value="./bin"/>
<property name="lib" value="./lib"/>
<property name="src" value="./src"/>
<property name="dist" value="./dist"/>
<property name="jarfile" value="${dist}/ejb.jar"/>
<property name="warfile" value="${dist}/webapp.war"/>
<property name="html" value="./WebContent"/>
<path id="my.classpath">
<pathelement path="${java.class.path}"/>
<pathelement location="${bin}"/>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${glassfish_libs}">
<include name="**/javax*.jar"/>
<include name="jsf-api.jar"/>
<include name="security.jar"/>
</fileset>
</path>
<target name="BuildAll"
depends="clean, prep, compile, jar, war"
description="Complete rebuild.">
<echo message="Build complete."/>
</target>
<target name="classpath">
<property name="current.classpath" refid="my.classpath"/>
<echo level="info">
Classpath is :
${current.classpath}
</echo>
</target>
<target name="clean">
<delete dir="${bin}"/>
<delete dir="${dist}"/>
<delete>
<fileset dir=".">
<include name="TEST*.xml"/>
</fileset>
</delete>
</target>
<target name="prep">
<mkdir dir="${bin}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile"
description="Compile all Java classes"
depends="prep">
<javac srcdir="${src}" destdir="${bin}" debug="true" encoding="ISO-8859-1">
<classpath refid="my.classpath"/>
</javac>
<echo message="Compiled."/>
</target>
<target name="jar" depends="compile"
description="Build EJB Jar files.">
<delete file="${jarfile}"/>
<jar destfile="${jarfile}" basedir="${bin}">
<metainf dir="${src}/META-INF">
<include name="persistence.xml"/>
</metainf>
</jar>
</target>
<target name="war" depends="compile"
description="Build WAR file.">
<copy todir="${bin}">
<fileset dir="${src}">
<include name="**/persistence.xml"/>
</fileset>
</copy>
<delete file="${warfile}"/>
<war destfile="${warfile}" webxml="web.xml">
<classes dir="${bin}">
</classes>
<lib dir="${lib}"/>
<fileset dir="${html}"/> <!-- html files -->
<!-- The following block is commented out, until
the chapter on security. Please leave it until then! -->
<!--
<webinf dir="${src}/META-INF">
<include name="sun-ejb-jar.xml"/>
</webinf>
-->
</war>
</target>
<target name="ear" depends="war, jar" description="The full ear file">
<ear destfile="${dist}/fullapplication.ear" appxml="application.xml">
<fileset dir="${dist}" includes="*.jar,*.war"/>
</ear>
</target>
那麼這裏是一個簡單的facelet - 它被稱爲entry.xhtml
<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:p="http://primefaces.prime.com.tr/ui">
<h:body>
<p:spinner></p:spinner>
</h:body>
我進口primefaces-4.0.jar和primeface-4.0-sources.jar通過右鍵單擊項目 - >構建路徑 - >配置構建路徑 - >添加外部容器
如果任何人都可以提供幫助,那將是可愛的
這是使用primefaces 2.2,所以我需要那個。嘗試用第4頁,沒有 – user2792920