The HTML Template Language (HTL) supported by Adobe Experience Manager (AEM) takes the place of JSP (JavaServer Pages) as the preferred and recommended server-side template system for HTML in AEM.
HTL over JSP
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:
Frequently Asked Questions
Before getting started with the HTML Template Language, let's start with answering upfront some questions related to the JSP vs HTL topic.
2.Does HTL support JSP Tag Libraries? No, but as shown in the Loading Client Libraries section, the template & call statements offer a similar pattern.
3. Can the HTL features be extended on an AEM project? No, but as shown in the Loading Client Libraries section, 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.
4.What are the main benefits of HTL over JSP? Security and project efficiency are the main benefits, which are detailed on the Overview .
5.Will JSP eventually go away? At the current date, there are no plans along these lines.