Galera, estou iniciando com o Faces, e gostaria da ajuda de vocês.
- Estou utilizando a versão free do Exadel com Eclipse;
- Faço um novo projeto e quando crio uma nova aplicação com JSF (utilizando a implementação 1.1 ) com uma uníca pagina( index.jsp ) para somente exibir algumas palavras dá o seguinte erro ao iniciar a página:
obs: se eu criar um projeto com base no myfaces 1.3 também dá o mesmo erro.
[b]
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
[i]
org.apache.jasper.JasperException: Exception in JSP: /index.jsp:8
5:
6:
7:
8: <f:view>
9: legal…
10: </f:view>
11:
[/i]
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Cannot find FacesContext
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.index_jsp._jspService(index_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.jsp.JspException: Cannot find FacesContext
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:405)
com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
org.apache.jsp.index_jsp._jspx_meth_f_view_0(index_jsp.java:85)
org.apache.jsp.index_jsp._jspService(index_jsp.java:60)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
[/b]
O meu arquivo index.jsp:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title></title>
</head>
<body>
<f:view>
legal....
</f:view>
</body>
</html>
O arquivo web.xml:
<?xml version="1.0"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>SomenteFaces</display-name>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
Eu não estou utilizando o jasper report, e não sei porque ele dá o erro na classe do jasper, alguem por favor pode me dar uma ajuda.
Obrigado.