<%
and
%>
, just as in JSP.
<%=
and %>
, or equivalently, between ${
and }
.<%--
and --%>
, which are ignored by
the template processor
and will not appear in the output.
document.write
to write data into the output stream.
document.include
to include files from within the template expansion
environment.templateContext
as a way of interfacing
with the Java environment, and you can invoke any
of its Java methods from within the template Javascript code.
document.include
call causes the template engine to read the contents of the specified
parameter file and expand its contents at that point. Nested includes are allowed, i.e., included files
may in turn include other files. Look
here for an example.
The predefined templateContext
Java object is wrapped in Javascript for easy access. Ideally,
you would pass a Java Map instance for the templateContext
. Doing so enables your Javascript
code to access the Map as if it were a regular Javascript array. If this Map contains other Map or List
instances or Java arrays within it, they are in turn wrapped automatically into the Javascript environment
so that they can be accessed as if they were Javascript arrays. You can also pass any Java object as an
element of the Map or its elements, and then proceed to invoke methods on the Java object.