我正在尝试在其网站上制作一个简单的PrimeFaces示例,如教程。我基本上有与this user完全相同的问题,但我没有像他那样的空的jar文件。 h:标签渲染正常,但p:标签在HTML中显示为p:标签。 PrimeFaces 3.1.1和3.2的相同问题。这是我的web.xml文件。Primefaces标签在Eclipse Facelets项目中未被识别
<?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_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>jsf</display-name>
<welcome-file-list>
<welcome-file>Login.xhtml</welcome-file>
</welcome-file-list>
<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></description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description></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></description>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener- class>
</listener>
<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>
</web-app>
我的XHTML文件看起来像这样。
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title><ui:insert name="title">Facelets Tutorial</ui:insert></title>
</h:head>
<body>
<p:editor />
<p:spinner />
</body>
</html>
我开始了我的服务器(Tomcat的6)和呈现的HTML看起来像这样,H:标签呈现精致和p:标签仍然号码:标签。
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.org/ui"><head>
<title>Facelets Tutorial</title></head>
<body>
<p:editor></p:editor>
<p:spinner></p:spinner>
</body>
</html>
我加入了PrimeFaces罐子到我的构建路径,我知道它是被认可的,因为我可以导入/使用PrimeFaces类只是在我的源文件的罚款。我甚至下载了PF源并将其添加到我的项目中以确保可以看到它,而且我仍然有这个问题。我的web.xml中是否需要一些额外的配置?
这结束了为我工作,谢谢! – json4639 2012-04-23 02:59:09