0

I migrated a jsf1 project to jsf2.
The webapp is based on Myfaces 2.1.8 , Tomahawk20-1.1.13 and ajax4jsf-1.1.1 - running on Tomcat 7. It all works well so I wanted to upgrade part of the pages to facelets and plug in Primefaces too.
The problem is that facelets pages do not render if I use jsf core tags - browser displays blank page, no errors in the logs either.
If the page is pure xhtml it renders fine. I know that this happens if the Faces servlet does not work at all but with a mapping of *.jsf it should first look for the .xhtml pages, right?
Any help will be appreciated.
It seems that facelets and ajax4jsf cannot coexist.

John Stadt
  • 500
  • 7
  • 17

1 Answers1

0

If your pages have a .xhtml extension your web.xml should contain something 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>*.xhtml</url-pattern>
</servlet-mapping>

If you have *.jsf as url-pattern and your pages have a .xhtml extension, it's obvious that the pages don't get rendered. In other words, the url-pattern must match the pages to be rendered.

siebz0r
  • 18,867
  • 14
  • 64
  • 107
  • I tried that too, still get the same problem. If I remove the ajax4jsf jar though, the facelets pages render. – John Stadt Aug 27 '12 at 09:14