This question already has answers here:
Doubly nested EL variables?
                            
                                (1个答案)
                            
                    
                    
                        How to nest an EL expression in another EL expression
                            
                                (2个答案)
                            
                    
                5个月前关闭。
        

    

<c:set var = "arrayIndex" value = "1"/>


如何通过上述语句设置的索引访问arrayList?
我以这种方式尝试过。

${arrayList[${arrayIndex}].object}

最佳答案

${}除去包围的${arrayIndex}符号可得到:

${arrayList[arrayIndex].object}

09-27 12:09