Hi
The question from Jwebplus
<%
request.setAttribute("names", new
String[]{ "A", "B", "C" } );
request.setAttribute("index", "1");
%>
<h1><!-- insert code here --></h1>
Which of the following statements will print B in inserted in the above
JSP page?
Select 3 correct options
a ${names.1}
b ${names[1]}
c ${names.index}
d ${names[index]}
e ${names.$index}
f ${names[$index]}
ans given is b,c,d
while I try the code for ${names[1]} and d ${names[index]} i am getting the expected result but for ${names.index} i am getting the error message as
" The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer. "
Can anybody tell what are the correct option for this questions?
Thanks