cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <>
Subject Re: FreeMarker integration
Date Mon, 09 Aug 2004 20:10:57 GMT
Tony Collen wrote:

> Leszek Gawron wrote:
>> Is anybody interested in FreeMarker integration with cocoon? There is 
>> no single word (Oh there are some freemarker occurences but they do 
>> not stick to the subject) about FreeMarker on the cocoon-dev list. It 
>> is BSD style licensed so there is no problem with shipping it with 
>> cocoon I think.
> Never heard of it.
I did, but it was the first time today I've read a comparison between 
FreeMarker and Velocity which looked very good (although "sponsored by" 
FreeMarker itself)

>> 3) JX Template generator is fine for simple cases but it lacks a lot 
>> of functionality i.e.:
>>    - control statements are very limited
>>    - you cannot plug in external tag implementations - jx:macro is good
>>      only for simple processing, you can do it only via a ugly "session
>>      hack" (${cocoon.session.wikifyFunction( "--string--",
>>               cocoon.consumer}), so it's very close to any extensions
>>    - you cannot set attribues via something similar to xsl:attribute as
>>      it is quite hard to implement (and might be inefficient)
> The generator is also a huge piece of code, and I would probably never 
> be able to confidently change something in there without fear of 
> breaking something.
The only thing I cannot solve right now about velocity or freemarker is 
how to implement caching. For jx:template I was able to provide a patch 
that allows caching because we had the control over jxtemplate syntax. 
Maybe the same would be possible by using some kind of macro that does 
not output any data but stores caching info in a well known location.

Still this is not that big problem. For most web applications there is 
almost no static content at all.

> I'd also like to add to the list of gripes about JXT:
>      - Confusing variable syntax: #{} vs ${}.  I know it's so we can use 
> the different syntaxes to our liking, but if they're equivalent, why 
> don't we just choose one and stick with it.  If they're not equivalent, 
> then we have other problems ;)
What is more problematic: some things you can do only with JXPath (like 
looping in macro with variable name defined in the template itself - you 
have to use . to reach current loop variable then), some things you can 
do only with Jexl. Some things you cannot do neither in Jexl nor in JXPath

>> I would never be able to leave cocoon:
>> - I cannot imaging my life without flowscript
>> - cforms is the best implementation for form handling there is. period.
> I agree.  I'm close to actually having a client who is willing to let me 
> use Cocoon for their site... I can't wait.
:) At last I found a way to use hibernate with cocoon in a well designed 
way: use Spring for the business layer. Right now the only thing I need 
is a good view generator.

Leszek Gawron                            

View raw message