how to Access httpsession in portletsession
Hi,
I have a problem with accessing httpsession attribute in portletsession,
I am able to get the session set inside the portletsession as shown in the below code,
Servlet class code,
-
request.getSession(false).setAttribute(IPConstants.PRODUCTS+ownerId,products);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher( response.encodeURL("/ip/invPrc") );
dispatcher.forward( request, response );
portlet class code,(inside doview)
-
PortletSession session = request.getPortletSession(false);
if((RenderRequest)session.getAttribute("Invoice_Search_ses",1)!=null){
request = (RenderRequest)session.getAttribute("Invoice_Search_ses",1);
}
but when I try to set a attribute in httpsession inside servlet,
note :this time the servlet call was made thro the activexobject(ajax) from jsp as shown below,
reqobj = new ActiveXObject("MSXML2.XMLHTTP.3.0");
reqobj.open("POST", "<%=IPHelper.getContextPath(request)+"/"+IPConstants.SERVLET_URL_INVOICE_SEA RCH%>", true);
reqobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
reqobj.onreadystatechange = loadSearchHandler;
reqobj.send(parameters);
servlet code,
--
request.getSession(false).setAttribute("Test_Naveen","Naveen");
out.print("<" + IPConstants.SERVLET_RESULT_ROOT + ">");
.
.
.
out.print("</" + IPConstants.SERVLET_RESULT_ROOT + ">");
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?
please help me in resolving this ?.

