我有一个grails应用程序,有一个像 -
这样的控制器def query = {
def options = ['X', 'Y', 'Z']
if (some criteria matches) {
render(view: "queryws", model: [opts: options])
}
}
在我的gsp中,我试图将值检索为 -
<tr>
<td><label for="env">Options:</label></td>
<td><g:select name="env"
from="${opts.list()}" id="select"
value="${params.env}" /></td>
</tr>
答案 0 :(得分:0)
您只需要MediaBrowserServiceCompat
,来自标记takes a list or range
答案 1 :(得分:0)
there is no env
is passed from controller .
print the ${opts}
is in gsp page. if is array then it will work..
for example
<g:select name="env" from="${['X', 'Y', 'Z']}"
value="" />