Package org.apache.ofbiz.widget.model
Class ScriptLinkHelper
java.lang.Object
org.apache.ofbiz.widget.model.ScriptLinkHelper
Utility to support different handling of code blocks in an html template:
1. Inline javascript tags are turned into external javascript tags for better compliance of Content Security Policy.
These external javascript tags are placed at the bottom of the html page. The scripts are retrieved via the getJs
request handler.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
cleanupScriptCache
(HttpSession session) cleanup the script cache when user session is invalidated.static String
getScriptFromCache
(HttpSession session, String fileName) Remove script from cache after reading.get the script links for page footer.static String
prepareScriptLinkForBodyEnd
(HttpServletRequest request, String fileName, String script)
-
Field Details
-
FTL_WRITER
- See Also:
-
SCRIPT_LINKS_FOR_BODY_END
- See Also:
-
-
Method Details
-
getScriptLinksForBodyEnd
get the script links for page footer. Also @seeScriptTagsFooterTransform
- Parameters:
request
-- Returns:
-
getScriptFromCache
Remove script from cache after reading.- Parameters:
session
-fileName
-- Returns:
- script to be sent back to browser
-
cleanupScriptCache
cleanup the script cache when user session is invalidated.- Parameters:
session
-
-
prepareScriptLinkForBodyEnd
public static String prepareScriptLinkForBodyEnd(HttpServletRequest request, String fileName, String script)
-