cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Pietschmann" <dev.sen...@gmail.com>
Subject AW: Access to the AuthenticationContext
Date Thu, 12 Jan 2006 14:26:17 GMT
Thank you, I had even tried that before, but just found out the reason why
it didn't work then - the Context doesn't properly support XPath:

I was requesting

getInputModuleAttribute("authentication//ID");

>From a quick look at the ContextInputModule you will see that this is only
translated into

context = contextManager.getContext("authentication");
something = context.getXML("//ID")
...

The context returns null. However, this works:
getInputModuleAttribute("authentication/authentication/ID");

I tried different ways retrieving information from the context:

context.getXML("authentication/ID"); -> "guest"
context.getXML("/authentication/ID"); -> "guest"
context.getXML("//ID"); --> NULL
context.getXML("authentication//ID"); --> NULL

The last both should be "guest" as well, but it's not working. If those
basics don't work, XPath is pretty useless to me. :(

Stefan


| -----Urspr√ľngliche Nachricht-----
| Von: Jean-Baptiste Quenot [mailto:jbq@anyware-tech.com]
| Gesendet: Donnerstag, 12. Januar 2006 14:36
| An: dev@cocoon.apache.org
| Betreff: Re: Access to the AuthenticationContext
| 
| * Stefan Pietschmann:
| 
| > So I tried many ways to get just one parameter:
| >
| > getInputModuleAttribute("/authentication/ID"));
| 
| The right one is:
| 
| getInputModuleAttribute("authentication/authentication/ID");
| 
| You can use XPath constructs only after the first component of the
| path.  As stated in the Javadoc:
| 
| This input module provides access to the information of a session
| context using an XPath. The XPath expression that can be used is
| the same as for the session transformer.  The first information in
| the path is the context, ...
| 
| See ContextInputModule.
| --
| Jean-Baptiste Quenot
| Systèmes d'Information
| ANYWARE TECHNOLOGIES
| Tel : +33 (0)5 61 00 52 90
| Fax : +33 (0)5 61 00 51 46
| http://www.anyware-tech.com/


Mime
View raw message