Question about "Cannot find FacesContext"
Dear Programmers
I have written a little application with JSF.
I have defined the web.xml that way:
<servlet>
<servlet-name>FacesServlet</servlet-name>
<display-name>FacesServlet</display-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>/faces/*</url-pattern>
</servlet-mapping>
And executed the application using the url: http://localhost:9080/TestJSFBook/faces/listBooks.jsp
Until here everything is ok.
Now I want to remove the "/faces" from the url, therefore I have defined the servlet mapping as following:
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
But I get "javax.servlet.jsp.JspException: Cannot find FacesContext"
Why is happen? Why can't I map it that way?

