我想使用 Facelets 构建静态 HTML 原型。该原型将发送给没有运行 Web 应用程序服务器(例如 Tomcat)的人。有没有办法在构建时(使用 Ant 等)将 Facelets 站点编译成一组平面 HTML 文件?
在最简单的情况下,我们有两个这样的 facelets:
<!-- layoutFacelet.xhtml -->
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:insert name="content" />
</ui:composition>
<!-- implementationFacelet.xhtml -->
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="layoutFacelet.xhtml">
<ui:define name="content">
HELLO WORLD
</ui:define>
</ui:composition>
输出将是单个 html(例如“implementationFacelet.output.html”),例如:
HELLO WORLD
换句话说,Facelets 在构建时而不是渲染时运行,以便生成静态平面文件原型。