Anything dodgy about doing this in my PageWrapper class? It seems to work...

        /**
         * Returns the current D2W context, creating one if it doesn't already 
exist...
         * @return
         */
        public D2WContext d2wContext() {
                NSSelector<Void> sel = new NSSelector<Void>("d2wContext");
                if(sel.implementedByObject(context().page())) {
                        return (D2WContext) 
context().page().valueForKey("d2wContext");
                }       
                if (context().hasSession()) {
                        return new D2WContext(context().session());
                }
                return new D2WContext();
        }

I'm creating a D2W context if there isn't already one provided by the page.

I think this is the only way I can make non-D2W components aware of
the D2W rules?

Thanks,

Mark

-- 
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to