Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

tags JSF

Caros,

Estou rodando meu código da página livro.xhtml e estou encontrando uma certa dificuldade em visualizar os campos. Verifiquei várias vezes e não estou digitando os comandos de maneira errada. Verifiquei se o endereço do "xmlns" estava correto, e por fim a visualização das tags não-Jsf funcionam normalmente. Abaixo disponibilizo o código da página ".xhtml":

<?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">
    <h:body>
        <h1>Novo Livro</h1>
        <h:form>
            <fieldset>
                <legend>Dados do Livro</legend>
                    <h:panelGrid columns="2">

                        <h:outputLabel value="Titulo:" for="titulo" />
                            <h:inputText  id="titulo"/>

                        <h:outputLabel value="ISBN:" for="isbn"/>
                            <h:inputText id="isbn"/>

                        <h:outputLabel value="Preco:" for="preco" />
                            <h:inputText id="preco"/>

                        <h:outputLabel value="DataLancamento:" for="dataLancamento"/>
                            <h:inputText id="dataLancamento"/>

                            <h:commandButton value="gravar" action="#{livrobean.gravar}" />
                    </h:panelGrid>
            </fieldset>
        </h:form>
    </h:body>
</html>

Poderiam me ajudar a solucionar?

2 respostas
solução!

Matheus boa tarde,

você já ta com o arquivo faces-config.xml ?

faces-config.xml

<faces-config version="2.2"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
</faces-config>

index.xhtml

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

Fonte: https://clairtonluz.github.io/blog/2014/03/2014032299.html

Bom dia Guilherme.

Problema em questão solucionado. Apenas alterei a configuração do arquivo faces-config.xml e os campos foram exibidos.

Muito obrigado!!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software