jsf - 警告:此页面调用以前缀 t 声明的 XML 命名空间 http://xmlns.jcp.org/jsf/component 但该命名空间不存在标记库
问题描述
我正在使用JSF 2.2
并且我想创建一个custom component
using 注释。但是,访问welcome.xhtml时出现以下错误:
Warning: This page calls for XML namespace http://xmlns.jcp.org/jsf/component declared with prefix t but no taglibrary exists for that namespace.
也许问题在于我不能在@FacesComponent
注释中使用“createTag”
@FacesComponent(value="components.HelloWorldComponent")
public class HelloWorldComponent extends UIComponentBase{
@Override
public String getFamily() {
// TODO Auto-generated method stub
return "hello.world.component";
}
@Override
public void encodeBegin(FacesContext context) throws IOException {
ResponseWriter writer = context.getResponseWriter();
writer.write("Hello everyone");
}
}
这是我的welcome.xhtml
<!DOCTYPE HTML>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
xmlns:t="http://xmlns.jcp.org/jsf/component"
>
<h:head>
<title>Hello World - Input Form1</title>
</h:head>
<h:body>
<h:form>
<h:inputText id="name" value="#{helloBean.name}"
p:placeholder="What's your name?" />
<h:commandButton value="Submit" action="hello" />
</h:form>
<t:helloWorldComponent/>
<h:outputText value="TEST"></h:outputText>
</h:body>
</html>
解决方案
推荐阅读
- google-cloud-platform - 如何通过 SSH 连接到 GCP 上的 kubernetes/GKE 集群中的节点
- kubernetes - 由于缺少配置,运行 kubectl patch --local 失败
- python - 如何为熊猫多索引中每个零级组的第一行赋值
- unix - 使用大于数字的列值过滤文件(awk 不起作用)
- excel - 如何使用 VBA 根据该单元格的内容在 Excel 中定位一个单元格,然后将该单元格(偏移)移动到右侧的一个单元格?
- python-3.x - ValueError:支持的目标类型是:('binary','multiclass')。取而代之的是“连续”。Python
- vue.js - 在 Vue 项目的 Cordova 应用程序中找不到图像
- reactjs - 部署strapi并将js反应到heroku
- c# - 在 asp.net core 中将 HTML 转换为 PDF 的问题
- c++ - 在 Arduino 上管理一系列对象问题