Class ContentHelper

java.lang.Object
org.deltava.taglib.ContentHelper

public class ContentHelper extends Object
A Helper class to check whether content has been aded into this request.
Since:
1.0
Version:
9.0
Author:
Luke
See Also:
  • Method Details

    • addContent

      public static void addContent(PageContext ctx, String contentType, String contentName)
      Updates a request-located map of all inserted content files.
      Parameters:
      ctx - the JSP PageContext
      contentType - the type of content (css/js)
      contentName - the name of the inserted content
      See Also:
    • containsContent

      public static boolean containsContent(PageContext ctx, String contentType, String contentName)
      Determines if a particular content file has been inserted during this request invocation.
      Parameters:
      ctx - the JSP PageContext
      contentType - the type of content (css/js)
      contentName - the name of the content
      Returns:
      TRUE if the content has been added, otherwise FALSE
      See Also:
    • clearContent

      public static void clearContent(ServletRequest req)
      Clears any included content with resetting the request, like when forwarding to an error page. The push content list is not cleared since the headers have already been set.
      Parameters:
      req - the ServletRequest
    • getBrowserContext

      public static HTTPContextData getBrowserContext(PageContext ctx)
      Fetches the browser data.
      Parameters:
      ctx - the PageContext object
      Returns:
      an HTTPContextData bean, or none if null
      See Also:
    • pushContent

      public static void pushContent(PageContext ctx, String url, String type)
      Adds an HTTP/2 preload link header to the response.
      Parameters:
      ctx - the PageContext object
      url - the URL to push
      type - the type of resource