如何通过Markupbuilder创建Gsp标签



我想创建这样的gsp文件:

但我找不到如何用markupbuilder编写代码。

我的代码如下:MarkupBuilder mb=新groovy.xml.MarkupBuilder(strXml(;

def builderA = new StreamingMarkupBuilder()
def gsp = builderA.bind{
html{
g.uploadForm(action:"saveDataItem"){
table{
f.with{
tr{
td{
"Test"
}
}
}
}
}
}
}
println XmlUtil.serialize(gsp)

它不起作用。

import groovy.xml.*
def mb = new StreamingMarkupBuilder()
def gsp = mb.bind {
html{
"g:uploadForm"(action:"saveDataItem"){
table{
tr{
td("Test")
}
}
}
}
}
println gsp.toString()

最新更新