That can happen when you have sent a request whose URL does not match the URL pattern of the FacesServlet
which in turn causes that the JSF works won't run at all. According to the URL pattern of your servlet mapping, you have to request your XHTML page with .jsf
extension. Imagine that you've an index.xhtml
, then you'd need to invoke it by http://localhost:8080/contextname/index.jsf.
I however recommend to just replace the *.jsf
URL pattern by *.xhtml
so that you never need to worry about and fiddle with suffixes. Change your web.xml
as follows:
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
And open the page by http://localhost:8080/contextname/index.xhtml.