grails - GSP pass Array from controller and display in gsp by its index -
how can pass array controller gsp, , view index in gsp?
lets in controller:
string[] str= new string[2]; str[0]="a" str[1]="b" render(view: "test_preview",model:[flag:str])
and in gsp, how can call let index [1] value "b" in gsp without looping possibly?
you can try this.
you pass full array view. , in view, following:
${flag[1]}
or: pass specific value view. in controller:
render(view: "test_preview",model:[flag:str[1])
and in view:
${flag}
Comments
Post a Comment