views:

35

answers:

1

Suppose I have a block of Gant code:

 target(echo:"test"){
    ant.echo(message:"hi")
 }
 setDefaultTarget("echo")

This is usually run from a command line.

How could I place the block in a Grails controller and run it from there?

A: 

You can use AntBuilder for this:

class FooController {

   def index = {
      def ant = new AntBuilder()
      ant.echo(message:"hi")
   }
}
Burt Beckwith
Dear Burt, thank you for your nice solution. Does this mean that I cannot simply copy the rich grails scipts to my controllers for use?
john