cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabrizio Sitzia" <fabrizio.sit...@chem.lu>
Subject Re: Java objects in JX templates
Date Mon, 30 Jan 2006 11:25:56 GMT
Hello,

I upgraded two webapps from Coccon 2.1.7 to 2.1.8 lately...

And I found this thread intriguing, so I have added the following to one
of my existing JX templates (which is run through a JX generator pipeline,
invoked by flowscript):

  <p>
      <jx:set var="items" value="alpha,beta,gamma"/>
      <jx:set var="delims" value=","/>
      <jx:set var="mytokenizer" value="${java.util.StringTokenizer(items,
delims)}"/>
      <jx:forEach var="token" begin="1" end="${mytokenizer.countTokens()}">
          ${mytokenizer.nextToken()}<br/>
      </jx:forEach>
  </p>


The html result:

  <p>
          alpha<br>
          beta<br>
          gamma<br>
  </p>


So, it appears to work fine for flowscript! (Mi spiace, Ugo ;-)
(Don't know about Javaflow, though!)

Fabrizio


BTW. the reason I was intrigued is that I'm using similar constructs in
production webapps - which made me wonder why users haven't been
complaining if indeed this feature had stopped working after migrating to
Cocoon 2.1.8 :->


>> ${java.util.StringTokenizer(items, delims)}
>>
> According to my tests, it doesn't work in 2.1.8, regardless of
> whether I use flow or not and whether I prepend "Packages." or not.
> Can anyone else confirm this?


Mime
View raw message