【发布时间】:2012-11-07 15:03:39
【问题描述】:
我需要一个真正的jsp-mode模板引擎,不像jade和ejs:
- 只需在网页文件夹中新建一个页面文件,在浏览器中输入它的uri,它就会显示出来
- 删除这个页面文件,它就会消失
- 并支持
<%include %>like jsp(支持查询参数)
如果有更多的财富,它会支持像apache tile这样的tile。在 apache 瓦片中,我可以编写一个模板页面,如
main.jsp:
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertTemplate template="/layout/simple.jsp">
<tiles:putAttribute name="header" value="/common/header.jsp" />
<tiles:putAttribute name="left" value="/common/leftmenu.jsp" />
<tiles:putAttribute name="body" value="<%= request.getParameter("body")%>" />
<tiles:putAttribute name="footer" value="/common/footer.jsp" />
</tiles:insertTemplate>
现在输入main.jsp?body=content1.jsp,你会看到content.jsp出现在main.jsp里面,换装layout/simple.jsp。
我可以做以上所有运行时,不需要重新启动网络服务器。
【问题讨论】:
标签: node.js jsp express tiles template-engine