Interface FlushHeadEarlyService

All Known Implementing Classes:
DefaultFlushHeadEarlyService

public interface FlushHeadEarlyService
A service that provides various utility methods for providing Flush Head Early support.
Since:
v7.2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Causes the servlet to render the <head> element of the document, including all resources that have been added to the page using the PageBuilderService.
    boolean
     
    void
    Requires all resources defined in the item's <web-panel>.
  • Method Details

    • isFlushHeadEarly

      boolean isFlushHeadEarly()
      Returns:
      whether the current request is flushing the head early or not
    • requireResourcesOfItem

      void requireResourcesOfItem(String item)
      Requires all resources defined in the item's <web-panel>.

      Resources for a <web-panel> can be defined in the <param name="flushHeadEarlyResources"> parameter. These will be required and included in the <head> before it is flushed.

      Valid definitions for resources are
      • wr!web-resource-key
      • wrc!web-resource-context-key
      where wr stands for WebResource and wrc stands for WebResourceContext - the same style as used in WRM.require in JavaScript. This also supports adding KeyboardShortcut contexts with:
      • kb!keyboard-shorcut-context-name
      where keyboard-shorcut-context-name must be an instance of KeyboardShortcutManager.Context Multiple resources can be separated by , or just whitespace.
      Parameters:
      item - <web-item> key or corresponding <web-panel> location
    • flush

      void flush()
      Causes the servlet to render the <head> element of the document, including all resources that have been added to the page using the PageBuilderService.

      Warning: No changes to the HTTP Response header can be made after this. This includes cookies, HTTP sessions, HTTP status code or anything else that would be sent in the HTTP header.

      Throws:
      IllegalStateException - When isFlushHeadEarly() returns false and flush() is called.