For long time users of AEM, this document gives the background on HTL, how it replaces JSP, and the change of name from Sightly.
HTML Template Language (HTL) is the preferred and recommended server-side template system for HTML in Adobe Experience Manager. It takes the place of JSP (JavaServer Pages) as used in previous versions of AEM.
It is recommended for new AEM projects to use the HTML Template Language, as it offers multiple benefits compared to JSP. For existing projects though, a migration only makes sense if it is estimated to be less effort than maintaining the existing JSPs for the coming years.
But moving to HTL is not necessarily an all-or-nothing choice, because components written in HTL are compatible with components written in JSP or ESP. Meaning that existing projects can without a problem use HTL for new components, while keeping JSP for existing components.
Even within the same component, HTL files can be used alongside JSPs and ESPs. Following example shows on line 1 how to include an HTL file from a JSP file, and on line 2 how a JSP file can be included from an HTL file:
<cq:include script="template.html"/> <sly data-sly-include="template.jsp"/>
These are some questions commonly asked by experienced AEM developers new to HTL.
No, but as shown in the Loading Client Libraries section of the Getting Started document, the template & call statements offer a similar pattern.
No, they cannot. HTL has powerful extension mechanisms for reuse of logic (the Use-API) and of markup (the template & call statements), which can be used to modularize the code of projects.
Security and project efficiency are the main benefits, which are detailed on the Overview.
There are no plans along these lines.
In AEM 6.0 and 6.1, HTL was referred to as Sightly. Adobe renamed it to HTML Template Language or HTL to clarify what the specification is for and to align with Adobe’s naming guidelines in general. This naming change was effective as of August 2016 and applies to AEM version 6.0 and forward.
This naming change does not impact code or the API, therefore compatibility is not affected. For more information, please refer to this announcement video.
To find out more about HTL and a great place to begin is our official Getting Started with HTML Templating Language (HTL) Guide.