<%
String[] strAry = {"String Array #1","String Array #2","String Array #3"};
List list = new ArrayList();
list.add("List #1");
list.add("List #2");
list.add("List #3");
Map map = new HashMap();
map.put("map1","Map #1");
map.put("map2","Map #2");
map.put("map3","Map #3");
ELTestBean elbean = new ELTestBean();
elbean.setName("ELTestBean");
elbean.setAry(strAry);
elbean.setList(list);
elbean.setMap(map);
pageContext.setAttribute("elbean", elbean);
%>
- プロパティアクセス
EL式 |
値 |
${ pageScope.elbean.name } |
ELTestBean |
- 配列アクセス
EL式 |
値 |
${ pageScope.elbean.ary[0] } |
String Array #1 |
${ pageScope.elbean.ary["0"] } |
String Array #1 |
${ pageScope.elbean.ary['0'] } |
String Array #1 |
${ pageScope.elbean.0 } |
無効な式 |
- リストアクセス
EL式 |
値 |
${ pageScope.elbean.list[1] } |
List #2 |
${ pageScope.elbean.list["1"] } |
List #2 |
${ pageScope.elbean.list['1'] } |
List #2 |
${ pageScope.elbean.list.1 } |
無効な式 |
- マップアクセス
EL式 |
値 |
${ pageScope.elbean.map.map3 } |
Map #3 |
${ pageScope.elbean.map["map3"] } |
Map #3 |
${ pageScope.elbean.map['map3'] } |
Map #3 |
SCWCD Exam Study Kit: Java Web Component Developer Certification (ペーパーバック)
指定されたパートは存在しません。
YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto
Copyright© 矢木 浩人 All Rights Reserved.