This content has been marked as final.
Show 3 replies
-
1. Re: Multiple parse on JSF page
jimk1723 Feb 21, 2008 12:44 AM (in response to xtof83)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.
-
2. Re: Multiple parse on JSF page
pmuir Feb 21, 2008 12:35 PM (in response to xtof83)I think that facelets loads off disk, not using URLs like that.
I think you would need to implement a custom FaceletsResourceResolver for this.
-
3. Re: Multiple parse on JSF page
jimk1723 Feb 21, 2008 7:23 PM (in response to xtof83)Doh! Yup, doesn't work. My own example was too simple.