This content has been marked as final. Show 2 replies
In order to share attributes across the HttpSession/PortletSession, you must specify PortletSession.APPLICATION_SCOPE. Application scope is the default in your servlet, but you must specify it in your portlet to get at the attributes stored.
Also, see my technical article on using HttpSession/PortletSession and AJAX in portlets:
The code is in the portlet repository:
I am struck with the issue of getting attributes set in portlet session into HTTP session.
I have to show a file download dialog box when a user clicks on a button on my jsp.
I wrote the code in jsp by setting content type and header. but it was throwing IllegalStateException when I tried to get ServletOutputStream. So I resorted to do the download code in a servlet.
The problem in servlet is that when I say
HttpSession session = request.getSession();
it gives me a new session not the existing one. so i am not able to get the attribute i have saved in portletsession.In portlet's processaction i have set attribue as
portletSession.setAttribute("myAttribute", Info, PortletSession.APPLICATION_SCOPE);
I am using glassfish server.
Please help me.