Interface HstSiteMapItemHandler
-
- All Known Subinterfaces:
FilterChainAwareHstSiteMapItemHandler
- All Known Implementing Classes:
AbstractFilterChainAwareHstSiteMapItemHandler
,AbstractHstSiteMapItemHandler
public interface HstSiteMapItemHandler
A HstSiteMapItemHandler can be invoked by HstFilter when the resolved sitemap item is configured with custom sitemap item handler IDs in the HST configurations. HstSiteMapItemHandler is provided to enable custom request processing for the resolved sitemap item.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
destroy()
Deprecated.since 13.0.0 : #destroy won't be invoked any more and will be removed.void
init(javax.servlet.ServletContext servletContext, SiteMapItemHandlerConfiguration handlerConfig)
Allows the HstSiteMapItemHandler to initialize itselfResolvedSiteMapItem
process(ResolvedSiteMapItem resolvedSiteMapItem, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Does custom request processing.
-
-
-
Method Detail
-
init
void init(javax.servlet.ServletContext servletContext, SiteMapItemHandlerConfiguration handlerConfig) throws HstSiteMapItemHandlerException
Allows the HstSiteMapItemHandler to initialize itself- Parameters:
servletContext
- the servletContext of the HST container servlethandlerConfig
- the componentConfigBean configuration- Throws:
HstSiteMapItemHandlerException
-
process
ResolvedSiteMapItem process(ResolvedSiteMapItem resolvedSiteMapItem, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws HstSiteMapItemHandlerException
Does custom request processing.This method can return the original resolvedSiteMapItem or a new resolved sitemap item to serve a different one. Or it can return null when it completes the custom request processing by itself so HstFilter needs to stop the request processing.
- Parameters:
resolvedSiteMapItem
-request
-response
-- Returns:
- a new or the original
ResolvedSiteMapItem
, ornull
when the handler did for example already write the entireresponse
and request processing can be stopped - Throws:
HstSiteMapItemHandlerException
-
destroy
@Deprecated void destroy() throws HstSiteMapItemHandlerException
Deprecated.since 13.0.0 : #destroy won't be invoked any more and will be removed. On everyVirtualHosts
rebuild (aka after hst config changes),HstSiteMapItemHandler
instances are recreated. Make sure that your implementation of theHstSiteMapItemHandler
does not result in a memory leak, for example because you add objects to a class variable like a static cache. The reason why this has been deprecated is that HstSiteMapItemHandler instances now piggy-back on the lifecycle on theVirtualHosts
instead of on a separate registryAllows the sitemap handler to destroy itself- Throws:
HstSiteMapItemHandlerException
-
-