struts2 s:选择值ognl表达式

pio*_*rek 2 struts2 ognl

s:select我看到的Struts2 标签教程中:

<s:select label="Pets"
       name="petIds"
       list="petDao.pets"
       listKey="id"
       listValue="name"
       multiple="true"
       size="3"
       required="true"
       value="%{petDao.pets.{id}}"
/>                          ^  ^
Run Code Online (Sandbox Code Playgroud)

和我的问题:为什么value="%{petDao.pets.{id}}"?为什么不简单value="%{petDao.pets.id}"?那些尾随花括号的意思是什么?

Ale*_*r M 5

这是一个OGNL列表投影,用于将所有id值作为列表从中获取petDao.pets,这意味着<s:select>将预先选择此中的所有值.