Dúvida JSF - Porque não aparece nada?

2 respostas
pvrsouza

Galera,

Porque com esse fonte não aparece nada quando testo no navegador?
<?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:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <h:form>
            <h:commandButton value="Testar o Hibernate"/>     
        </h:form>
    </h:body>
</html>

P.S: Esse é meu primeiro contato com o JSF.

2 Respostas

maxmustang

Tu deve ter esquecido de colocar o <f:view> e fechar ele
da um bizu

pvrsouza

Quando eu coloque a tag dá esse erro:

This page contains the following errors:

error on line 3 at column 20: Namespace prefix f on view is not defined
error on line 5 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
<?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">
<f:view contentType="text/html"/>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        Hello from Facelets
        <h:form>
            <h:commandButton value="teste" action="#"/>

        </h:form>
    </h:body>
</html>
</f:view>
Criado 29 de outubro de 2010
Ultima resposta 29 de out. de 2010
Respostas 2
Participantes 2