code095.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>EL表达式访问数组</title>
</head>
<body>
<%
String arr[] = new String[] {"Java Web开发","Java手册","JSP葵花宝典"};
request.setAttribute("book", arr);
%>
<%
String[] arr2 = (String[])request.getAttribute("book");
for(int i=0;i<arr2.length;i++)
{
request.setAttribute("index", i);
%>
${index}:${book[index]}<br>
<%
}
%>
</body>
</html>