Managed Runtime

The same code as the "Inline Groovy" example, this time with an explicitly managed Groovy runtime. The Groovy runtime is instantiated into the application scope once, and then used across all requests. This is the correct way to use CFGroovy and is very fast.

If you put your runtime at application.cfgroovy, the <g:script> tag will automatically use it. If it's somewhere else, you must explicitly pass it via the cfgroovy attribute of <g:script> or use the <g:setRuntime> tag each request (the latter usually being preferable). Otherwise, you'll revert to the basic inline model, where a new runtime is implicitly created each request (which is slow).

No Emery

// better add emery variables.myArray.add("emery")

There He Is!