Subir pagina index JSF

5 respostas
R

Galera eu estou montando uma aplicação em jsf criei uma pagina index.html que aponta para uma pagina xhtml de login mais estou chamando a pagina index na URL mais esta dando erro que não achou a pagina alguém pode ajudar será que tem a ver com algum desses dois arquivos abaixo ?

Aqui esta meu faces config

<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xi="http://www.w3.org/2001/XInclude"
 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">
 <navigation-rule>
  <display-name>login</display-name>
  <from-view-id>/login/login.xhtml</from-view-id>
  <navigation-case>
   <from-outcome>menu</from-outcome>
   <to-view-id>/menu/menu.xhtml</to-view-id>
  </navigation-case>
 </navigation-rule>
 <navigation-rule>
  <display-name>index</display-name>
  <from-view-id>/index.html</from-view-id>
  <navigation-case>
   <from-outcome>redirecionaLogin</from-outcome>
   <to-view-id>/login/login.xhtml</to-view-id>
  </navigation-case>
 </navigation-rule>
</faces-config>

Aqui esta meu 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>aplicacaoTeste</display-name>
  <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>
      <welcome-file-list>
        <welcome-file>/index.html</welcome-file>
    </welcome-file-list>
</web-app>

o que esta faltando ?

5 Respostas

leoramos

Ao invés de redirecionar, podes colocar o teu xml configurado como abaixo, já que é pro sistema já abrir na tela de login.

&lt;welcome-file-list&gt; &lt;welcome-file&gt;/login/login.xhtml&lt;/welcome-file&gt; &lt;/welcome-file-list&gt;

no lugar do index.html, mas TALVEZ seja sem a ‘/’, agora não tenho certeza e não tô com o Eclipse aberto.

R

leoramos eu alterei usando as duas formas mas continua com o mesmo problema alguém teria mais uma sugestão ?

leoramos

Que duas tags? Era só uma o.0
O teu sistema tem que abrir direto na página de login? Se for isso, faz isso:

&lt;welcome-file-list&gt; &lt;welcome-file&gt;/index.html&lt;/welcome-file&gt; &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; coloque aqui tua página de login &lt;/welcome-file-list&gt;

E depois reiniciar a tua aplicação. Qualquer coisa, depois de alterar, cola o código todo que a gente te socorre!

R

leoramos

as duas formas que falei e com a / ou sem a / que vc falou que não tinha certesa…

eu reiniciei a aplicação e testei mais não foi

meu xml ficou assim

<?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>aplicacaoTeste</display-name>
  <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>
		 <welcome-file-list>    
		    <welcome-file>/login/login.xhtml</welcome-file>    
		 </welcome-file-list> 
</web-app>
leoramos

Cara, desculpa se não tô conseguindo ajudar… dá uma olhada nesse post, pode ajudar:

http://www.guj.com.br/posts/list/134749.java

Um abraço!

Criado 3 de setembro de 2009
Ultima resposta 3 de set. de 2009
Respostas 5
Participantes 2