[jsp]代码库
pageEncoding="UTF-8"%>
Insert title hereStudent student = new Student("陈毛毛",18,"上海");
request.setAttribute("s1", student);
%>
${s1 }
${s1.name }
${s1.age }
${s1.city }
String[] names = {"西门庆","西门崔雪","西门抽血","西门抽筋"};
request.setAttribute("names", names);
%>
${names }
${names[0] }
${names[1] }
${names[2] }
${names[3] }
List list = new ArrayList();
list.add("aaa");
list.add("bbb");
list.add("ccc");
request.setAttribute("list", list);
%>
${list }
${list[0] }
${list[1] }
${list[2] }
Map map = new HashMap();
map.put("aaa.ddd", "111");
map.put("bbb", "222");
map.put("ccc", "333");
request.setAttribute("map", map);
%>
${map }
${map["aaa"] }
${map["bbb"] }
${map["ccc"] }
${map.aaa.ddd }
${map["aaa.ddd"] }
List list1 = new ArrayList();
list1.add(new Student("李寒",18,"上海"));
list1.add(new Student("孙在驰",19,"香港"));
list1.add(new Student("李羿成",17,"东京"));
request.setAttribute("student", list1);
%>
${student[0].name }
${student[0].age }
${student[0].city }