cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "iyy" <...@apparelxml.net>
Subject Re: Session.getAttribute problem: cocoon 2.1.3 dev
Date Wed, 22 Oct 2003 11:23:21 GMT
Hi Mr. Bowler,

Your code works brilliantly..
Only correction I had to make was to use DefaultContextManager class instead
of ContextManager.
In the Cocoon 2.1.3 dev, ContextManager class in session jar is a
interface.. implemented by  DefaultContextManager.

I am able to get session xml , and return a value to sitemap.

Thank you very much,

I have been working in Cocoon for more than an year now, and if you have any
doubts about xsp,xml,xsl , pls
feel free to write to me at :  iyy@apparelxml.net

From,
iyyappan

----- Original Message -----
From: "Paul Bowler" <paulbowler@www.aventix.co.uk>
To: "iyy" <iyy@apparelxml.net>; <users@cocoon.apache.org>
Sent: Wednesday, October 22, 2003 2:58 PM
Subject: Re: Session.getAttribute problem: cocoon 2.1.3 dev


> Actually, the code I gave was pulled directly out of one of my actions.
>
> Don't forget that to get the 'manager' object your component should
implement composable (you should read up on the
> Avalon framework if this is new to you).
>
> Here is some code for a dummy action that should get you started. No
guarantees it is perfect though.
>
> public class DummyAction extends AbstractAction implements Composable {
>
> private ComponentManager manager;
>
> /**
> * Composable
> */
> public void compose(ComponentManager manager) {
> this.manager = manager;
> }
>
> /**
> *
> */
> public DummyAction() {
> super();
> }
>
> public Map act(Redirector redirector, SourceResolver resolver, Map
objectModel, String source, Parameters
> params) throws Exception {
>
> ContextManager cm = null;
> cm = (ContextManager) this.manager.lookup(ContextManager.ROLE);
> SessionContext context = cm.getContext("authentication");
> // If no context then user has not logged on
> if (context == null) {
> return null;
> }
> DocumentFragment df = context.getXML("/authentication");
> // User has logged on
> NodeList nl = df.getChildNodes();
>                 ... You code goes here
> }
> }
>
>
> --
> Paul Bowler
> Aventix Associates Ltd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message