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

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    since 13.0.0 : #destroy won't be invoked any more and will be removed.
    void
    init(jakarta.servlet.ServletContext servletContext, SiteMapItemHandlerConfiguration handlerConfig)
    Allows the HstSiteMapItemHandler to initialize itself
    process(ResolvedSiteMapItem resolvedSiteMapItem, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Does custom request processing.
  • Method Details

    • init

      void init(jakarta.servlet.ServletContext servletContext, SiteMapItemHandlerConfiguration handlerConfig) throws HstSiteMapItemHandlerException
      Allows the HstSiteMapItemHandler to initialize itself
      Parameters:
      servletContext - the servletContext of the HST container servlet
      handlerConfig - the componentConfigBean configuration
      Throws:
      HstSiteMapItemHandlerException
    • process

      ResolvedSiteMapItem process(ResolvedSiteMapItem resolvedSiteMapItem, jakarta.servlet.http.HttpServletRequest request, jakarta.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, or null when the handler did for example already write the entire response and request processing can be stopped
      Throws:
      HstSiteMapItemHandlerException
    • destroy

      Deprecated.
      since 13.0.0 : #destroy won't be invoked any more and will be removed. On every VirtualHosts rebuild (aka after hst config changes), HstSiteMapItemHandler instances are recreated. Make sure that your implementation of the HstSiteMapItemHandler 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 the VirtualHosts instead of on a separate registry
      Allows the sitemap handler to destroy itself
      Throws:
      HstSiteMapItemHandlerException