To fazendo um curso do livro Programação Java para Web.
Bom estou na seguinte situação.
meu 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_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>FinanceiroWeb</display-name>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<filter>
<filter-name>conexaoFilter</filter-name>
<filter-class>financeiro.web.filter.ConexaoHibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>conexaoFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</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>
</web-app>
meu 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_2_0.xsd"
version="2.0">
<managed-bean>
<managed-bean-name>usuarioBean</managed-bean-name>
<managed-bean-class>financeiro.web.UsuarioBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>inicio</from-outcome>
<to-view-id>/index.html</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>usuario</from-outcome>
<to-view-id>usuario.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>usuario.xhtml</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/mostraUsuario</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
dentro da minha Classe UsuarioBean.java tem o método que faz um
private String novo(){
this.usuario = new Usuario();
this.usuario.setAtivo(true);
return "usuario"; // usando navegação implícita quando ao chamar o método ele abrira o USUARIO.XHTML que esta na pasta publico/usuario.xhtml
}
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=publico/login.jsf">
<h:commandButton action="#{usuarioBean.novo}" value="Registre-se"/>
ele retorna o erro ao seguir:
HTTP Status 500 - java.io.FileNotFoundException: /usuario.xhtml Not Found in ExternalContext as a Resource
type Exception report
message java.io.FileNotFoundException: /usuario.xhtml Not Found in ExternalContext as a Resource
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.io.FileNotFoundException: /usuario.xhtml Not Found in ExternalContext as a Resource
financeiro.web.filter.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:44)
root cause
java.io.FileNotFoundException: /usuario.xhtml Not Found in ExternalContext as a Resource
com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:224)
com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:265)
com.sun.faces.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:193)
com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:741)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)
financeiro.web.filter.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:31)
muito estranho ele dizer que o arquivo /usuario.xhtml Not Found
pois o arquivo esta na pasta correta.
o arquivo usuario.xhtml
esta na pasta
WebContent publico login.xhtml usuario.xhtml usuarioSucesso.xhtml
alguém pode me dar uma LUZ....
grande abraço.
corretamente
ao clicar no botão de registro que esta na
