EL表达式

 

<%
        String s = "abc";
        request.setAttribute("sa", s);
    %>
    ${sa }
    </br>
    <%
        List list=new ArrayList();
        list.add(new Person("aa"));
        list.add(new Person("bb"));
        list.add(new Person("cc"));
        request.setAttribute("slist", list);
    %>
    ${slist[2].name }
    </br>
    <%
        Map map = new HashMap();
        map.put("aa", new Person("aaa"));
        map.put("bb", new Person("bbb"));
        request.setAttribute("smap", map);
    %>
    ${smap.bb.name}
    </br>

<%-- 获取当前应用的名称 --%>
${pageContext.request.contextPath }

 

posted on 2013-11-06 00:27  上校  阅读(226)  评论(0编辑  收藏  举报