cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: Hiding business logic in flow: how to get at naked request?
Date Thu, 25 Dec 2003 01:24:44 GMT
Sylvain Wallez wrote:

> There is a way. Not that straightforward, though.
>
> You should use the new cocoon.createObject(classname) method that 
> instanciates an object and goes through the various lifecycle 
> interfaces. Your class has to be Contextualizable, and you can then 
> get the request from the context using ContextHelper.getRequest(context).
>
> Now I agree with you that having a restricted object model in the flow 
> is too much constraining.
>
> Sylvain
>
One way to make this easier would be to make 
FOM_Request/Response/Session/Context implement the 
Request/Response/Session/Context interfaces. These interfaces would not 
be accessible in JS code but would be in Java code. The only drawback is 
for code that attempts to downcast e.g. Request to HttpRequest which 
would not work. Since HttpRequest is a class, not an interface, it 
cannot be implemented by FOM_Request. Given that is the case, such 
downcasting is probably a Bad Thing (TM) anyway.


Mime
View raw message