Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/01/2013, 07:55
VicDeras
 
Fecha de Ingreso: enero-2013
Mensajes: 2
Antigüedad: 11 años, 3 meses
Puntos: 0
xhtml jsf eclipse

Buen día tengo problema ejecutando un hola mundo en xhtml, si lo hago con jsp no me da problemas pero a la hora de querer ponerlo con extension .xhtml ya no me sirve no me tira error pero el navegador se queda en blanco. Este es mi codigo:


Archivo index.xhtml
Cita:
<!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:c="http://java.sun.com/jstl/core" >
<head>
<title>Hola Mundo</title>
</head>
<body>
<f:view>
<h:outputText value="Hola mundo"/>
</f:view></body>
</html>
Archivo web.xml
Código:
<?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>prueba</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>*.jsf</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>
   <context-param>
  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  <param-value>.xhtml</param-value>
 </context-param>
  <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
  </listener>
</web-app>
Estoy desesperado he intentado de todas formas cambiar e archivo web.xml y reiniciando el servidor pero nada, he cambiado esto en el web.xml:
Código:
<servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>faces/*</url-pattern>
    </servlet-mapping>
  <context-param>
También lo he puesto de esta manera
Código:
<servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/prueba/</url-pattern>
    </servlet-mapping>
  <context-param>
Y no funciona, he probado de todo y no puedo hacer que funcione, espero que me puedan ayudar gracias.