@SuppressWarnings("unchecked")
    public List<String> getScriptsToExecute() {
        List<String> scriptsToExecute =
            (List<String>) context.getAttributes().get(EXECUTE_SCRIPTS_KEY);

        if (scriptsToExecute == null) {
            scriptsToExecute = new ArrayList<>();
            context.getAttributes().put(EXECUTE_SCRIPTS_KEY, scriptsToExecute);
        }

        return scriptsToExecute;
    }
@return all scripts added in the current request.
primefaces/src/main/java/org/primefaces/context/PrimeRequestContext.java