EL表达式基础
<%
String[] fruit={"苹果","西瓜","芒果","香蕉"};
request.setAttribute("fruit", fruit);
session.setAttribute("username", "EL表达式");
List list=new ArrayList();
list.add("天下");
list.add("秦朝");
list.add("赵国");
list.add("燕国");
session.setAttribute("country", list);
Map<String,String> map=new HashMap();
map.put("1", "洛阳理工学院");
map.put("2", "河南科技大学");
map.put("3", "洛阳师范学院");
map.put("4", "河南大学");
application.setAttribute("college1", map);
%>
得到一个水果名称: ${requestScope.fruit[3]}<br/>
得到数组的第一个元素: ${requestScope.fruit[0]}<br/>
得到List数组的第一个元素: ${sessionScope.country[0]}<br/>
得到Map的第一个元素:${applicationScope.college1["2"]}<br/>
${sessionScope.username}<br/>
<% Map map1=(HashMap)application.getAttribute("college1");%>
<%=map1.get("1") %>
${2+1}