paribe
Novembro 11, 2010, 9:00am
#1
Olá,
estou tentando montar primeira pagina jsf 2.0 mais aparece a seguinte mensagem,
chamando a url abaixo :
http://localhost:8080/ProjetoJSF2/index.xhtml
Transferencia de arquivos
Pretende guardar este arquivoou localizar um programa online para abrir ?
Nome : index.xhtml
Tipo:tipo de arquivo desconhecido
de : localhost
localizar guardar cancelar
_______________________
<?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:head><title>JSF 2.0</title></h:head>
<h:body>
<h:form id=?form1″>
<h:outputText value=?Primeiro exemplo com JSF 2.0″ />
</h:form>
</h:body>
</html>
_____________
<?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_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>ProjetoJSF2</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.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>/faces/*</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: client or server (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
Das duas uma, tente acessar a página como http://localhost:8080/ProjetoJSF2/faces/index.xhtml ou modifique as suas configurações da seguinte maneira:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
paribe
Novembro 11, 2010, 9:44am
#3
Olá,
ao chamar a url http://localhost:8080/ProjetoJSF2/index.html
não aparece nada porque será ??? alguém ode me ajudar …abs
<?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_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>ProjetoJSF2</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</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>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: client or server (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:outputText value=?Primeiro exemplo com JSF 2.0″ />
<ui:composition template="">
<ui:define name="header">
Add your header here or delete to use the default
</ui:define>
<ui:define name="content">
Add your content here or delete to use the default
</ui:define>
<ui:define name="footer">
Add your footer here or delete to use the default
</ui:define>
</ui:composition>
</html>
no browser tenta colocar .jsf com terminação do aquivo.
tenta tb tirar h:head e h:body e ve se funciona ai
paribe
Sei que o post é antigo rs
Mas você lembra como solucionou o seu problema?
to com o mesmo problema bizarro aqui rs
paribe
Março 25, 2012, 9:43am
#6
Olá,
era a página index.xhtml não estava em WebContent…
abs