CFGroovy Demo

Links: CFGroovy homepage | source for this page. | groovy grouping demo

This demo creates an array of strings, CFDUMPs it, and then uses various scripting languages to add new elements to the array and output it to the page. Groovy and JavaScript are guaranteed to work, Python, PHP, and Ruby will also run if you have Jython, Quercus, and JRuby JARs on your classpath.

Starting Array

Array
1
stringHello, world.

Run some Groovy

[Hello, world., Groovy is...Groovy!]

Run some JavaScript

[Hello, world., Groovy is...Groovy!, JavaScript is lovely!]

Run some Python (via Jython)

Jython needs to be added to your classpath for the Python example to work

Run some PHP (via Quercus)

Quercus needs to be added to your classpath for the PHP example to work

Run some Ruby (via JRuby)

JRuby needs to be added to your classpath for the Ruby example to work

Run move Groovy

List:
  "Hello, world."
  "Groovy is...Groovy!"
  "JavaScript is lovely!"
  "CF Runtime: Railo 9,0,0,1"
  "User Agent: claudebot"

Final Array

Array
1
stringHello, world.
2
stringGroovy is...Groovy!
3
stringJavaScript is lovely!
4
stringCF Runtime: Railo 9,0,0,1
5
stringUser Agent: claudebot