【发布时间】:2012-03-29 06:54:02
【问题描述】:
我发现了类似的问题here,但它不再帮助我了。但是我面临同样的问题。运行我的应用程序时出现以下错误:
警告:页面 /template/common.xhtml 声明了命名空间 http://primefaces.org/ui 并使用标签 p:panel ,但没有与命名空间关联的 TagLibrary。
下面是我的 index.xhtml 的 sn-p :
<ui:composition template="/template/common.xhtml"
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">
<ui:define name="profile">
这就是我的 common.xhtml 文件的外观(不是放整个内容,只是命名空间和 1-2 行):
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Welcome to my website</title>
<h:outputStylesheet library="css" name="default.css" />
</h:head>
<h:body>
<div id="header" style="margin: auto; width: 80%;">
<p:panel>
正如 BalusC 在here 所描述的,必须定义 xmlns="http://www.w3.org/1999/xhtml"。我也在做同样的事情。即 index.xhtml 文件的第二行也是如此。但我仍然遇到错误。
【问题讨论】:
标签: jsf-2 primefaces websphere xml-namespaces