JSF context not found...

I created a web application with Java Server Faces framework selected in Netbeans.

IDE gives two pages at first. one is index.jsp and other is welcomeJSF.jsp. When I cut some jsf related code from welcomeJSF.jsp page and paste it into index.jsp and run the applicationI get this error:

"org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext"

what is the difference between index.jsp and welcomeJSF.jsp..?

here is my web.xml:

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" 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-app_2_5.xsd">

<context-param>

<param-name>com.sun.faces.verifyObjects</param-name>

<param-value>false</param-value>

</context-param>

<context-param>

<param-name>com.sun.faces.validateXml</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>javax.faces.STATE_SAVING_METHOD</param-name>

<param-value>client</param-value>

</context-param>

<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>

<session-config>

<session-timeout>

30

</session-timeout>

</session-config>

<welcome-file-list>

<welcome-file>

index.jsp

</welcome-file>

</welcome-file-list>

</web-app>

[2210 byte] By [xyzta] at [2007-11-27 9:58:59]
# 1

No difference. You will got the same error message if you try to type welcomeJSF.jsp in the browser URL directly. Any request to the JSF page (page that contains JSF tags) should pass the Faces servlet. In your case, you have to add "/faces/" prefix before the page name.

I.e. something like:

http://localhost:8080/myapp/faces/index.jsp

instead of just:

http://localhost:8080/myapp/index.jsp

Sergey.Smirnova at 2007-7-13 0:29:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks a lot.
xyzta at 2007-7-13 0:29:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...