Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在jsp中有一张地图
<s:set name="answer" value="#{0:'No', 1:'Yes', 2:'Maybe' }"/>
如何使用密钥访问答案图?
<s:property value="?"/>
尝试这个
<s:set name="answer" value="#{'0':'No', '1':'Yes', '2':'Maybe' }"/> <s:property value="#answer['1']"/>
编辑:对不起,在移动设备上读错了。
#theMap[theKey]
使用创建<s:set>的变量是命名变量,必须使用前导#.
<s:set>
#