[RESOLVIDO] JSF 2.0 problemas com taglibs

10 respostas
tonyam

estou fazendo um exemplo com jsf 2.0, quando uso:

<h:messages/>

aparecem alertas como estes:

Warning: This page calls for XML namespace declared with prefix a but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix img but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix img but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.

algém poderia me ajudar

10 Respostas

tonyam

Resolvido,

Era que no meu template, eu tinha incluidos outras páginas com <h:include/>.

Eu acho que é bug. Coloquei o conteúdo das páginas no próprio tamplate, e a mensagem desapareceu

soro

Ainda não cheguei a implementar em JSF 2.0, mas nas versões anteriores com uso do faceletes (se não me engano, existe a obrigatoriedade do faceletes no JSF 2.0), você definia com as tagas do facelets, normalmente nomeadas como: UI. E quando usado o template você dizia em que parte do template estaria inserindo aqueles trechos de código.

tonyam

Todas as paginas incluidas com “include” tem que ter:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

nas minhas não tinha. depois que coloquei, funcionou

ralphsilver

Complementando,

Quando se faz uso de templates,

As páginas que tem o composition deve ter o xmlns configurado também:

<ui:composition template="/template/template.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:f="http://java.sun.com/jsf/core">

bruno.neves

Galera eu sei que o post já tem um tempo mais como estou com esse problema e tudo que está no post eu já fiz e não funcionou gostaria de saber se alguem pode me ajudar?

Essas são as tags da minha pagina de Template

<?xml version='1.0' encoding='UTF-8' ?>
<!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:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">


e essas são as tags da pagina que eu utilizo esse template

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                template="meuTemplate.xhtml"
                xmlns:f="http://java.sun.com/jsf/core">

Estou usando o Primefaces 2.2 e as mensagens do mesmo.

A

hehehe
Vlw!
Resolvido tb com este post!

lucasddaniel

Resolvi com a taglib:

xmlns=“http://www.w3.org/1999/xhtml

Gleidson_Henrique

lucasddaniel:
Resolvi com a taglib:

xmlns=“http://www.w3.org/1999/xhtml

Comigo também funcionou assim… Tentei fazer como comentando mais acima, mas funcionou somente desse jeito.

Abraços

rlorensi

Gleidson Henrique:
lucasddaniel:
Resolvi com a taglib:

xmlns=“http://www.w3.org/1999/xhtml

Comigo também funcionou assim… Tentei fazer como comentando mais acima, mas funcionou somente desse jeito.

Abraços

Aqui rolo tb vlw!

MartinsAndreDablio

funcionou aqui também show… _o/

Criado 26 de maio de 2010
Ultima resposta 17 de nov. de 2014
Respostas 10
Participantes 9