posted 17 years ago
Hi all,
Consider the following code,
<html>
<body>
<% java.util.List list=new java.util.ArrayList ();
list.add ("1");
list.add ("2");
list.add ("3");
request.setAttribute ("list",list);
request.setAttribute ("listidx","0");
%>
Value at first postion is :${list[list['listidx']]}
Expected result is 2, but browser shows exception.
Same piece of code is available in exercise for scriptless jsps, HFJS page no 420, Question no 6. One of the correct options provided says ${list[list['listidx']]} EL expression is valid to return value present in 2nd position. but that is not working.
please tell me solution for the above problem.
Thanks and Regards,