是否可以使用Struts访问说集合中的第3个元素? [英] Is it possible to access say the 3rd element in a collection with Struts?
本文介绍了是否可以使用Struts访问说集合中的第3个元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Struts/JSP中是否可以执行以下操作?
Is there a way to do the following thing in Struts / JSP?
<html:checkbox property="list.get(0).checked" />
谢谢.
推荐答案
如果要访问JSTL列表中的第3个元素,语法就像数组:
If you want to access the 3rd element in a list in JSTL, the syntax is just like arrays:
<html:checkbox property="list[2].checked" />
请注意,如果您不熟悉JSTL/EL,则必须将适当的jar添加到类路径中,并引用标记库.
Note that if you are new to JSTL/EL you'll have to add the appropriate jar to your classpath and reference the tag library.
这篇关于是否可以使用Struts访问说集合中的第3个元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文