Class ContentHelper
java.lang.Object
org.deltava.taglib.ContentHelper
A Helper class to check whether content has been aded into this request.
- Since:
- 1.0
- Version:
- 9.0
- Author:
- Luke
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addContent
(PageContext ctx, String contentType, String contentName) Updates a request-located map of all inserted content files.static void
Clears any included content with resetting the request, like when forwarding to an error page.static boolean
containsContent
(PageContext ctx, String contentType, String contentName) Determines if a particular content file has been inserted during this request invocation.static HTTPContextData
Fetches the browser data.static void
pushContent
(PageContext ctx, String url, String type) Adds an HTTP/2 preload link header to the response.
-
Method Details
-
addContent
Updates a request-located map of all inserted content files.- Parameters:
ctx
- the JSP PageContextcontentType
- the type of content (css/js)contentName
- the name of the inserted content- See Also:
-
containsContent
Determines if a particular content file has been inserted during this request invocation.- Parameters:
ctx
- the JSP PageContextcontentType
- 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
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
Fetches the browser data.- Parameters:
ctx
- the PageContext object- Returns:
- an HTTPContextData bean, or none if null
- See Also:
-
pushContent
Adds an HTTP/2 preload link header to the response.- Parameters:
ctx
- the PageContext objecturl
- the URL to pushtype
- the type of resource
-