I want to pass a value from my Java class to Javascript. I have set the value in portletSession. I don’t know how to get a value from portletSession into the Javascript.
Here is the code I have used to set the value in the portletSession.
PortletSession portletSession = request.getPortletSession();
portletSession.setAttribute("noExist", noExist);
How can I do that?
Don’t use portletSession, use Cookie instead. You can access cookies from javascript using
document.cookiesBut there is another way: just print the variable into script block and javascript can read it.
hope this help