通过计算结果访问数组索引
我尝试使用计算结果作为索引来访问数组。
status.index
来自一个 tr:iterator
变量 varStatus
。
然而,这似乎是内部的双精度值,因为我得到了 javax.servlet.ServletException: For input string: "0.0" 。
我可以以某种方式将其转换为整数吗?
I try to access an array using as index the result of a calculation.
<tr:outputText value="#{myController.form.model.arr[(status.index / 15)]}"/>
status.index
comes from a tr:iterator
variable varStatus
.
It seems howewer, that this is a double value internally as I get a javax.servlet.ServletException: For input string: "0.0"
.
Can I somehow cast this to an integer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,已经解决了。我有另一个星座,其中 .toString 是通过自己的方法添加的。它的工作方式与此处发布的方式相同。
Sorry it has been resolved. I had another constellation where a .toString was added by an own method. It works the way it is posted here.