Q:

JSF template not applied

I'm running into a problem with JSF and templating. I'm following this tutorial but the only output I see is the one I'm defining in my index.xhtml with
<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">
<ui:define name="content">
my custom content
</ui:define>

without adding the footer and header even though I'm not defining/overwriting the default one in my index file.
If I view the source in the browser it's showing up the same way as in my index.xhtml with ui:composition etc. So it looks like it's not "converting" it to HTML.
The relevant parts of my web.xml:
<servlet>
    <description>Controller Servlet for data input</description>
    <display-name>InputServlet</display-name>
    <servlet-name>InputServlet</servlet-name>
    <servlet-class>form.controller.InputServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>InputServlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>
</welcome-file-list>

My directory structure looks like this:
http://i.imgur.com/ZslOQNr.png
Thanks!

A:

You're using the wrong servlet.
JSF comes with its own servlet, the FacesServlet.
Get rid of the InputServlet from web.xml altogether and map JSF's FacesServlet as follows:
<servlet>
    <servlet-name>facesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>facesServlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

That should do it.
See also:

Our JSF wiki page - contains a Hello World and several links to sane tutorials

