It'd help to see where your at with some existing code, but I'll take a crack at it...
You should be able to do this with the Facelet's ui:include. I'm assuming you've got your Freemarker servlet set up in web.xml, something like:
<servlet-mapping> <servlet-name>freemarkerServlet</servlet-name> <url-pattern>*.fm</url-pattern> </servlet-mapping>
And all of your Freemarker templates are generating JSF like so:
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:outputText value="This was included!" /> </div>
So if you have a Freemarker template in your /view folder you can include it in a JSF page using
<ui:include src="/includepage.fm" />
Of course, in this simple example there's nothing stopping some one from getting http://yourserver/includepage.fm which could lead to shenanigans.
I think that facelets loads off disk, not using URLs like that.
I think you would need to implement a custom FaceletsResourceResolver for this.
Doh! Yup, doesn't work. My own example was too simple.