cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <coc...@leverageweb.com>
Subject Re: javax.servlet.http.HttpSession access from XSP?
Date Tue, 03 Feb 2004 14:50:30 GMT
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.

Oh, and for the record - there is now a third environment 
implementation: a portlet environment.

Geoff


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


Mime
View raw message