Class ThymeleafHstTemplateServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.onehippo.forge.templating.support.core.servlet.AbstractHstTemplateServlet
org.onehippo.forge.templating.support.thymeleaf.servlet.ThymeleafHstTemplateServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
- See Also:
-
Field Summary
FieldsFields inherited from class org.onehippo.forge.templating.support.core.servlet.AbstractHstTemplateServlet
CLASSPATH_TEMPLATE_PROTOCOL, serialVersionUID, WEB_FILE_TEMPLATE_PROTOCOLFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClear the template cache if available in the subclass.protected ObjectcreateTemplateContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Create a templating engine specific Context object which can be evaluated by the template.protected voidinitializeTemplateEngine(jakarta.servlet.ServletConfig config) Initialize the specific templating engine in a subclass.protected voidprocessTemplate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String templatePath, Object context) Resolve the template by thetemplatePathand process the template for the request with the templating engine specificcontextobject.Methods inherited from class org.onehippo.forge.templating.support.core.servlet.AbstractHstTemplateServlet
doGet, doPost, getTemplatePath, initMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
MESSAGE_RESOLVER
- See Also:
-
-
Constructor Details
-
ThymeleafHstTemplateServlet
public ThymeleafHstTemplateServlet()
-
-
Method Details
-
initializeTemplateEngine
protected void initializeTemplateEngine(jakarta.servlet.ServletConfig config) Description copied from class:AbstractHstTemplateServletInitialize the specific templating engine in a subclass. This method is invoked byAbstractHstTemplateServlet.init(ServletConfig)method during the initialization phase.- Specified by:
initializeTemplateEnginein classAbstractHstTemplateServlet- Parameters:
config- ServletConfig object
-
createTemplateContext
protected Object createTemplateContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from class:AbstractHstTemplateServletCreate a templating engine specific Context object which can be evaluated by the template.This method is invoked by
AbstractHstTemplateServlet.process(HttpServletRequest, HttpServletResponse)method before invokingAbstractHstTemplateServlet.processTemplate(HttpServletRequest, HttpServletResponse, String, Object)to pass a Context object to theAbstractHstTemplateServlet.processTemplate(HttpServletRequest, HttpServletResponse, String, Object).- Specified by:
createTemplateContextin classAbstractHstTemplateServlet- Parameters:
request- HttpServletRequest instanceresponse- HttpServletResponse instance- Returns:
- a Context object which can be evaluated by the template
-
processTemplate
protected void processTemplate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String templatePath, Object context) throws IOException Description copied from class:AbstractHstTemplateServletResolve the template by thetemplatePathand process the template for the request with the templating engine specificcontextobject.- Specified by:
processTemplatein classAbstractHstTemplateServlet- Parameters:
request- HttpServletRequest instanceresponse- HttpServletResponse instancetemplatePath- template pathcontext- Templating engine specific Context object which is evaluated by the template- Throws:
IOException- if IO exception occurs
-
clearTemplateCache
protected void clearTemplateCache()Description copied from class:AbstractHstTemplateServletClear the template cache if available in the subclass. It does nothing by default unless overridden.- Overrides:
clearTemplateCachein classAbstractHstTemplateServlet
-