render taglib body as code

1

17dufa

Guest
Hello,
can I write taglib in this way:
<g:myTag>
for (def i = 0; i < 10; ++i)
{
sum += i
}
</g:myTag>

....
myTag = {attrs, body ->
body = '''
def sum = 0
'''+body()+
'''
println sum
'''
out << body
}
so I see 2 problems, which soluthion I don't know:
1. write body without <% and %>
2. add lines of code before body and after body
 
Top