There is no index.html file in your project. Your welcome page is index.xhtml. take attention between xhtml and html.
Furthermore, if you have a servlet mapping for /faces/*
in your web.xml. index.xhtml should be accessed as http://myjsfapp.com/faces/index.xhtml?param=value
. It is possible to access http://myjsfapp.com/ index.xhtml?param=value
, but this URL will not have JSF capabilities.
Once you add a servlet mapping like
<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>
The request which includes /faces/*
patterns in the URL will be controlled by mapped servlet. It is Faces Servlet
and it will be controlled by javax.faces.webapp.FacesServlet
class. This servlet mapping give your requests JSF capability. Other URLs not having /faces/* will not run inside Faces Servlet
meaning there is no JSF capability.