有时你真的无法战胜简单:
def test() {
def map1=['a':1]
def map2=['a2':2]
def map3=map1+map2
println "000 ${map3} vs ${params}"
render view:'test', model:[map1:map1,map2:map2]
}
将地图传递给view gsp:
<g:set var="map6" value="${[hello1:'hello2',world1:'world2'] }"/>
<g:set var="currentParams" value="${params}"/>
${map1 } ${map6}
<g:link action="test" controller="test" params="${map1+map6+map2+currentParams}">test</g:link>
当我点击链接时显示
{a=1}{hello1=hello2,world1=world2}测试
点击后我的url是:
/test?a=1&hello1=hello2&world1=world2&a2=2&hello=hello&world=world
000 [a:1, a2:2] vs [hello:hello, a:1, a2:2, world1:world2, hello1:hello2, world:world, action:test, controller:test]
你想做什么?不