Dúvida facelets

4 respostas
tati.mat.moreira

Olá pessoal,

vou migrar meu projeto JSF pra Facelets. Estou criando um projeto simples pra aprender mas não estou conseguindo.

faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>

<faces-config
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
    version="1.2">

	<application>   
    	<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
	</application>

</faces-config>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>faceletsProject</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  
  <context-param>
		<param-name>javax.faces.default_suffix</param-name>
		<param-value>.xhtml</param-value>
  </context-param>
  
</web-app>
teste.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="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
<body>
<f:view>
	<h:outputText value="testeeeeeeeeeeeeeeeeeeee" />
</f:view>
</body>
</html>
libs:
el-api-1.0 el-impl-1.0 jsf-api-1.2_04-p02 jsf-facelets myfaces-all portlet jstl standard servlet-api-2.4
Erro:
HTTP Status 404 -

--------------------------------------------------------------------------------

type Status report

message

description The requested resource () is not available.

--------------------------------------------------------------------------------

Apache Tomcat/6.0.18

Onde estou errando? :cry:

4 Respostas

felipeguerra

Aqui tem tudo o que vc precisa saber:

https://facelets.dev.java.net/nonav/docs/dev/docbook.html

tati.mat.moreira

Nada ainda…

Coloquei as libs to MYFACES, mas deu na mesma.

Alguma alma boa? :roll:

marcosharbs

ta faltando varias libs pelo jeito
el, jstl, …
ta usando qual contaiber? tomcat?
se tive usando jsf 1.2 vai precisa ser a versao 6.0 do tomcat e tens que baixa essas libs que tao faltando ai.

felipeguerra

tati.mat.moreira:
Nada ainda…

Coloquei as libs to MYFACES, mas deu na mesma.

Alguma alma boa? :roll:

Estuda esse código aqui que estou enviando.
É gerado pelo JBoss Seam, ou seja, inquestionável o seu funcionamento…

Criado 11 de fevereiro de 2009
Ultima resposta 11 de fev. de 2009
Respostas 4
Participantes 3