Another version of 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.
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 you'll revert to the
basic inline model, where a new runtime is implicitly created.