Erro na configuração do WEB.XML

4 respostas
C

Pessoal, sou novo no fórum e estou com um probleminha. Configurei um arquivo WEB.xml e o mesmo está dando o seguinte erro: (error: Attribute location references to /error.jsp that does not exist in web content). Acontece que na pasta WebContent estou usando somente arquivos .xhtml, inclusive o error.xhtml pois defini o projeto desta forma. Interessante é que se eu ignoro o erro e compilo o código funciona mas o erro continua sendo apontado. O código do WEB.xml está abaixo. Caso alguém puder me ajudar:

<?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>Estoquel</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>index.xhtml</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    <welcome-file>default.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>
  
  <filter>
	<filter-name>LoginFilter</filter-name>
	<filter-class>filtros.LoginFilter</filter-class>
  </filter>

  <filter-mapping>
	<filter-name>LoginFilter</filter-name>
	<servlet-name>Faces Servlet</servlet-name>
  </filter-mapping>

  <filter>
	<filter-name>JPAFilter</filter-name>
	<filter-class>filtros.JPAFilter</filter-class>
  </filter>

  <filter-mapping>
	<filter-name>JPAFilter</filter-name>
	<servlet-name>Faces Servlet</servlet-name>
  </filter-mapping>
  
  <error-page>
	<exception-type>java.lang.Exception</exception-type>
	<location>/error.xhtml</location>
  </error-page>
  
</web-app>

4 Respostas

A

cara,

isso deve ser algum problema da sua IDE, da um clean no seu projeto, fecha e abre sua IDE, deve ser algo assim.

t+

C

Alisson, tudo bem ? Obrigado pela resposta. Pior que estou desconfiado que seja isto mesmo. Já fiz o clean, fechei e abri e nada. Estou usando o Eclipse Indigo.

A

entao cara,

o eclipse acostuma da uns problemas desse… :smiley:

t+

M

Uso o Eclipse Helios e tenho o mesmo problema… ainda não resolvi! :cry:

Criado 31 de outubro de 2011
Ultima resposta 11 de jan. de 2012
Respostas 4
Participantes 3