Firstly you need to explicitly state that its Session Application Scope:
PortletSession.setAttribute("listImage", m, PortletSession.APPLICATION_SCOPE);
Secondly check that your actually getting the same session in your servlet. If you dont see anything in the attributes it would indicate that its probably a different session, as even the PORTLET_SCOPE attributes would show up with some namespacing applied.
How are you 'calling' the servlet? Is it in the same webapp?
Luc Fouin wrote:
hello,
here is my problem, i've got a servlet called by a porlet and i want to get 2 different values: one in parameter, which is not a pb, and one passing as an attribute...
i've done a :
rReq.getPortletSession().setAttribute("listImage", m);
rReq is my javax.portlet.RenderRequest and m is an java.util.Map... then i do:
Enumeration en = rReq.getPortletSession().getAttributeNames();
while (en.hasMoreElements()) {
System.out.println(en.nextElement());
}
to check that my attibute is passed, and it is...
but after, with :
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { Enumeration en = req.getSession().getAttributeNames(); while (en.hasMoreElements()) { System.out.println(en.nextElement()); } }
no information is returned, there's nothing in my attributes...
i thought by reading the jsr-168 specs that a portlet and a sevlet were sharing the same session??
thx, Luc
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
