|
I'm using the authentication framework too, but to
get something from the session, I use session-fw:
xmlns:xsp-session-fw=http://apache.org/xsp/session-fw/1.0
<xsp:logic>
String roleFrag = <xsp-session-fw:getxml as="string"
context="authentication" path="/authentication/role"/>;
DocumentFragment nameFragment = (DocumentFragment)<xsp-session-fw:getxml
as="object" context="authentication" path="/authentication/data/name"/>;
String name = new String();
for(int i = 0; i<
nameFragment.getChildNodes().getLength(); i++){
nameString.append(nameFragment.getChildNodes().item(i).getNodeValue());
}
</xsp:logic>
You can find it at the wiki's: http://wiki.cocoondev.org/Wiki.jsp?page=XspSessionFw
I use < .. as="object" ..> in the
second variable because when I started using this, the <.. as="string" >
only returned the first text node although the real text in an element may be
split up in different text nodes. That's also why I have that for loop to append
each text node to the string to obtain the full text. It's possible that this
has been changed in the cvs head as I did mail it on this list and there was
some response by the developer(s) of that logicsheet.
Kind Regards,
Jan
|
- Getting additional user's information from session object (... Mariusz Wojcik
- Jan Hoskens
