I have a problem with running JSF 2.0 on AppEngine. I have following index.xhtml
and if I deploy it and open the page, there is nothing but the Title
Check this link for MyFaces and GAE Support. It has some hints about how to setup correctly this environment and if you need more information you can suscribe to MyFaces Users Mailing List. To see a running example using JSF on GAE check this link MyFaces HTML5 Demo
This can happen if the request URL as you've in the browser address bar does not match the URL pattern of the FacesServlet
as definied in web.xml
. It's the one responsible for parsing the Facelet file, creating the FacesContext
and doing all the JSF works.
You have mapped the FacesServlet
on /faces/*
, so that means that you've to include /faces/
after the context path in the request URL to get it to run. I.e.
http://example.com/contextpath/faces/index.xhtml
Alternatively, you can also change the URL pattern to
<url-pattern>*.xhtml</url-pattern>
so that all XHTML (Facelet) files will be parsed by FacesServlet
anyway.
This typically happens if a request is not handled by the Faces Servlet and has is not specifically about GAE.
What URL did you used to access your page? Since you declared a prefix mapping, you have to insert /faces/ into your URLs, e.g. my.appspot.com/faces/mypage.xhtml.
I would recommend going for suffix mapping and using .xhtml exclusively:
<servlet-mapping>
<servlet-name>facesServlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>