I am writing a Groovlet and would like to delegate part of the HTML builder to a method but am having trouble getting it to work. Below is what I have:
def pages = [page1: html.p("page1")]
html.html {
p("p")
pages[page1]
}
I am expecting the following output:
<html>
<p>p</p>
<p>page1</p>
</html>
Instead what I get is the following:
<p>text</p>
<html>
<p>p</p>
</html>
What am I doing wrong?