[Building Sakai] session variables in JSR-168 portlet

Tobias Schiebeck Tobias.Schiebeck at manchester.ac.uk
Wed Apr 8 03:52:35 PDT 2009


Hi all,

I'm trying to move a JSR-168 portlet into Sakai-2.5.x . I have the
problem that I can't find out how to get to the session variables which
are set by the portlet in the servlet that it belongs to.

We currently use in the portlet:

PortletSession portletSession = request.getPortletSession();
portletSession.setAttribute(namespace + XMLRPC_SERVER_ATTRIBUTE,
                    xmlRpcServer,PortletSession.APPLICATION_SCOPE);

in the servlet we try to get the thing back using

xmlRpcServer = getJspContext().getAttribute(
        namespace + PagPortlet.XMLRPC_SERVER_ATTRIBUTE,
        PageContext.SESSION_SCOPE);

unfortunately this returns null rather than the attribute.

looking through the set attributes  using:

Enumeration attributes = getJspContext().getAttributeNamesInScope(
        PageContext.SESSION_SCOPE);
while (attributes.hasMoreElements()) {
    System.err.println(
         " attr: " + attributes.nextElement());
}

they don't seem to be existent at all.

Is there something we do wrong for sakai as we think this is JSR-168 ?

Thanks for your help

Tobias

-- 
---------------------------------------------------------------------
Tobias Schiebeck                    tobias.schiebeck at manchester.ac.uk
Research Computing Services           http://www.rcs.manchester.ac.uk
The University of Manchester                  tel: (+44) 161-275-0601
---------------------------------------------------------------------



More information about the sakai-dev mailing list