Предупреждение: эта страница вызывает пространство имен XML http://xmlns.jcp.org/jsf/component, объявленное с префиксом t, но для этого пространства имен не существует библиотеки тегов - PullRequest
0 голосов
/ 21 мая 2019

Я использую JSF 2.2, и я хотел бы создать custom component, используя аннотации. Однако при доступе к 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.

Возможно, проблема в том, что я не могу использовать "createTag" в @FacesComponent аннотации

@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>
...