Created
November 20, 2016 16:26
-
-
Save ndemengel/08ad00f19a0436a589554fd2e0a3d515 to your computer and use it in GitHub Desktop.
Handlebars taglib example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ taglib prefix="hbs" uri="http://www.hopwork.com/jsp/jstl/handlebars" %> | |
<%-- preferred form: all needed data are computed outside of the view and put into ${headerData} --%> | |
<hbs:render template="common/header" context="${headerData}"/> | |
<%-- sometimes, it's still useful to tweak the view independently of the data --%> | |
<hbs:render template="some/other/template"> | |
<hbs:contextProperty name="someCondition" value="true"/> | |
<hbs:contextProperty name="someConfigProperty" value="SOME_CONFIG_VALUE"/> | |
<hbs:contextProperty name="data" value="${someData}"/> | |
</hbs:render> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment