引用hivon的CSDN博客,网址:http://blog.csdn.net/hivon/article/details/2315399
<input type="button" value="report3" οnclick="window.location.href='<g:createLink controller="report" action="bar3" />'"></input>
<input type="button" value="report4" οnclick="window.location.href='<g:createLink controller="report" action="bar4" />'"></input>
<input type="button" value="pie1" οnclick="window.location.href='<g:createLink controller="report" action="pie1" />'"></input>
。。。。。。。
可以用template模板,一般来说,以下划线开头的文件名的gsp文件都是Template。所以我把我的第一个Template命名为_test.gsp:
<input type="button" value="${value}" οnclick="window.location.href='<g:createLink controller="${control}" action="${action}" />'"></input>
包含三个变量:value、control和action。
引用为:<g:render template="test" model="[value:'nulti',control:'report',action:'multi']"/>
即可。