ISO-8859-1 vs Chrome (facelets vs Chrome) [resolvido]

5 respostas
J

Galera, seguinte:

Não estou conseguindo rodar minhas aplicações jsf (facelets) no Google Chrome. Template:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j"
	  >
	<head>
		<title></title>
	</head>
	<body>
		<f:view locale="pt_BR">
			<div id="pagina">
				<!-- Topo, Menu -->
				<div id="corpo">
					<ui:insert name="corpo">Corpo</ui:insert>
				</div>
				<!-- Rodape -->
			</div>
		</f:view>
	</body>
</html>
Página:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<ui:composition template="/paginas/templates/comun.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"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	>
    <ui:define name="corpo">
    	Olá <h:outputText value=" #{usuario.nome}" style="color: #0000FF"/>, seja bem vindo!
    	<br /><br />
    	Você acessou o sistema <h:outputText value=" #{usuario.numeroAcessos}" style="color: #0000FF"/> vezes.
		<!-- Continua -->
	</ui:define>
</ui:composition>
Desse modo ele (chrome) me "fala": error on line 55 at column 44: XML declaration allowed only at the start of the document Procurando na net(inlusive aqui no guj) encontrei que tinha que tirar a linha
<?xml version="1.0" encoding="ISO-8859-1" ?>
Tirando essa linha passa a "reclamar" do seguinte: Error Parsing /paginas/pagina.xhtml: Error Traced[line: 15] Invalid byte 2 of 3-byte UTF-8 sequence. :x Sinuca de bico heim! hehehe

Podem me ajudar? Qual é a solução?

5 Respostas

alves.Felipe

cara… tenta tirar esta linha da sua página:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

mas deixa a o template…

rod

Sua página e seu projeto está usando qual encoding?

J

alves.Felipe:
cara… tenta tirar esta linha da sua página:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

mas deixa a o template…

Não resolveu mano…

J

rlazoti:
Sua página e seu projeto está usando qual encoding?

Aonde eu encontrei essa opção(Propriedades do arquivo e do projeto - eclipse) eu coloquei ISO-8859-1.
Aonde posso encontrar essa configuração?

J

Resolvido galera,

o problema na verdade estava nos includes que existem no template template.xhtml
<?xml version="1.0" encoding="ISO-8859-1" ?>  
 <!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:ui="http://java.sun.com/jsf/facelets"  
       xmlns:h="http://java.sun.com/jsf/html"  
       xmlns:f="http://java.sun.com/jsf/core"  
       xmlns:rich="http://richfaces.org/rich"  
       xmlns:a4j="http://richfaces.org/a4j"  
       >  
     <head>  
         <title></title>  
     </head>  
     <body>  
         <f:view locale="pt_BR">  
             <div id="pagina">  
                 <div id="topo">
                     <ui:include src="/paginas/templates/topo.xhtml" />
                 </div>
                 <div id="corpo">  
                     <ui:insert name="corpo">Corpo</ui:insert>  
                 </div>  
                 <!-- Rodape -->  
             </div>  
         </f:view>  
     </body>  
 </html>
topo.xhtml (antes)
<?xml version="1.0" encoding="ISO-8859-1" ?>
<ui:insert name="topo"
	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"
  	xmlns:rich="http://richfaces.org/rich"
  	xmlns:a4j="http://richfaces.org/a4j">
  
	<h:graphicImage value="/paginas/imagens/logo.png" />
<!-- tem mais aqui -->
</ui:insert>
e agora:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<ui:composition
	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"
  	xmlns:rich="http://richfaces.org/rich"
  	xmlns:a4j="http://richfaces.org/a4j">
  
	<h:graphicImage value="/paginas/imagens/logo.png" />
<!-- tem mais aqui -->
</ui:insert>
saiu o ui:insert e entro o ui:composition

valew pela ajuda

rlazoti
e
alves.Felipe

aquele abraço!!! :D

Criado 6 de julho de 2010
Ultima resposta 6 de jul. de 2010
Respostas 5
Participantes 3