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
Fields inherited from class org.onehippo.forge.templating.support.core.servlet.AbstractHstTemplateServlet
CLASSPATH_TEMPLATE_PROTOCOL, serialVersionUID, WEB_FILE_TEMPLATE_PROTOCOL
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Clear the template cache if available in the subclass.protected Object
createTemplateContext
(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 void
initializeTemplateEngine
(jakarta.servlet.ServletConfig config) Initialize the specific templating engine in a subclass.protected void
processTemplate
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String templatePath, Object context) Resolve the template by thetemplatePath
and process the template for the request with the templating engine specificcontext
object.Methods inherited from class org.onehippo.forge.templating.support.core.servlet.AbstractHstTemplateServlet
doGet, doPost, getTemplatePath, init
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods 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:AbstractHstTemplateServlet
Initialize the specific templating engine in a subclass. This method is invoked byAbstractHstTemplateServlet.init(ServletConfig)
method during the initialization phase.- Specified by:
initializeTemplateEngine
in classAbstractHstTemplateServlet
- Parameters:
config
- ServletConfig object
-
createTemplateContext
protected Object createTemplateContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from class:AbstractHstTemplateServlet
Create 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:
createTemplateContext
in 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:AbstractHstTemplateServlet
Resolve the template by thetemplatePath
and process the template for the request with the templating engine specificcontext
object.- Specified by:
processTemplate
in 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:AbstractHstTemplateServlet
Clear the template cache if available in the subclass. It does nothing by default unless overridden.- Overrides:
clearTemplateCache
in classAbstractHstTemplateServlet
-