Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 95921 invoked from network); 3 Feb 2004 22:07:52 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Feb 2004 22:07:52 -0000 Received: (qmail 73644 invoked by uid 500); 3 Feb 2004 22:07:23 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 73463 invoked by uid 500); 3 Feb 2004 22:07:22 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 73441 invoked from network); 3 Feb 2004 22:07:22 -0000 Received: from unknown (HELO host.leverageweb.com) (64.91.254.192) by daedalus.apache.org with SMTP; 3 Feb 2004 22:07:22 -0000 Received: from va-leesburg-cmts5c-90.chvlva.adelphia.net ([67.21.159.90] helo=leverageweb.com) by host.leverageweb.com with esmtp (Exim 4.24) id 1Ao8wj-0003QD-HW for users@cocoon.apache.org; Tue, 03 Feb 2004 17:23:05 -0500 Message-ID: <40201B6A.1050101@leverageweb.com> Date: Tue, 03 Feb 2004 17:06:34 -0500 From: Geoff Howard User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: javax.servlet.http.HttpSession access from XSP? References: <3F93B638.5080008@ish.de> <67C442DD-5511-11D8-A4D0-003065A85E10@sparkbc.com.au> <401E9A4A.3080106@gmx.de> <03DCA0FC-55CE-11D8-BDE0-003065A85E10@sparkbc.com.au> <401EDE47.3020900@gmx.de> <401F16AC.7050301@leverageweb.com> <401FB2DA.3000005@leverageweb.com> In-Reply-To: <401FB2DA.3000005@leverageweb.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.leverageweb.com X-AntiAbuse: Original Domain - cocoon.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - leverageweb.com X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Geoff Howard wrote: > Phil Blake wrote: > >>> By the way, it's important that people know the basic reason Cocoon >>> doesn't give you an HTTP session. Cocoon abstracts the environment >>> so that it can be run from many different environments, not just >>> http/servlet. Currently the command line interface is the only other >>> implemented environment but even there dependency on servlet jar and >>> HttpSession obviously makes no sense. Examples of other potential >>> environments which have been discussed are email (via James) and JMS. >>> >>> Now, that doesn't mean it should be impossible to get to the >>> HttpSession if you are in that environment and that's what we need to >>> see. I think the method which is used in the other environment >>> abstractions (Request for example) won't work here, but I don't see a >>> reason cocoon's session couldn't implement HttpSession. Right now, >>> it seems the only methods unimplemented from the javax interface are >>> the deprecated methods. Another alternative would be to use JDK 1.3 >>> dynamic proxy which may work if the code you pass the proxy to >>> doesn't call the deprecated methods (I can't remember for sure if >>> this is true). >> >> >> >> Good point Geoff. >> >> This is a specialised case. I think you'd only want access to the >> HttpSession for this kind of integration. Perhaps a _wrappedSession() >> method on org.apache.cocoon.environment.Session is too easy to abuse. >> A little opinionated documentation could help with that. :) >> >> Any comments? > > > I was thinking more of just declaring that the cocoon HttpSession > implements the javax interface as I mention above. It would be easiest > to implement the deprecated methods to just throw an exception. Does > Cayenne need them? If we do this, you could just pass the cocoon > session along with a possible cast depending on how you got it. > > I've started a proposal on the dev list about this if you want to pipe > in or follow along there. Ok, I think the proposal to do this is not going to go anywhere, but there is a solution. You'll probably need to give more info (or remind us of it) of what code you are calling this from (action, flow, generator, transformer, etc.). While you are at it, can you give more info about what part of the Cayenne API relies on this? It is odd that they need an http session object - what if you wanted to use this code outside of a webapp? Geoff --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org