Hello,
I’m trying to create a global function that can be used by all of my components at runtime. My confusion is where to put the function (I keep reading that the /apps/ folder is not available to the dispatcher) and how to get the return value. Here’s an example of simple local cookie function that I’d like to be able to call from any of my components.
<%@page import="javax.servlet.http.Cookie"%><% boolean myCookie = false; Cookie[] cookies = request.getCookies(); for(int i = 0; i < cookies.length; i++) { Cookie c = cookies[i]; if (c.getName().equals("myaccount")) { myCookie = true; } } %>
Thanks - using CQ 5.5 Update 1