O'Reilly logo

Groovy and Grails Recipes by Bashar Abdul-Jawad

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 9Miscellaneous Recipes

In this chapter, I present miscellaneous recipes from different topics. Templating, working with XML, working with files, using regular expressions, using Groovy from the command line, downloading files, writing configuration files in Groovy, and using Groovy to run external processes are some of the examples I present in this chapter.

9-1. How Do I Use Groovy Templates to Generate Dynamic and Reusable Content?

In Recipe 3-1, I showed you how to use GStrings to generate dynamic content that can be useful in templating scenarios. Groovy also has a powerful dedicated template framework with several template engines that can be used to create templates with embedded JSP-like scriptlets and variables (JSP stands for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required