i am not able to access the above session attribute in the portletsession.
I doubt since it is a call thro ajax, the session attribute is not applied on to the application scope. is there any other way to set the httpsession explicitly in the application scope which i am missing?
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.