Retrieving data in a JSP page with an El expression

Source: Internet
Author: User

<%
Request.setattribute ("name", "Carving Heroes");
Application.setattribute ("name", "Deer Ding kee");
%>
${requestscope.name}

${applicationscope.name}

<%
String [] strs={"clan", "Leaf isolated City", "Simon blowing Snow", "Li Huan"};
Request.setattribute ("STRs", STRs);
%>
${STRS[1]}

<%
List<string> list=new arraylist<string> ();
List.add ("Zhou Zhijo");
List.add ("Small Zhao");
List.add ("Zhao");
List.add ("Spider");
Request.setattribute ("list", list);
%>
${LIST[2]}

<%
Map<string,string> map=new hashmap<string,string> ();
Map.put ("A", "Eastern Evil");
Map.put ("B", "West Poison");
Map.put ("C", "South Emperor");
Map.put ("D", "North hack");
Request.setattribute ("map", map);
%>
${map[' B '}

${map. C

<%
List<user2> ulist=new arraylist<user2> ();
Ulist.add (New User2 ("Liu Bei", "147"));
Ulist.add (New User2 ("Guan Yu", "258"));
Ulist.add (New User2 ("Zhang Fei", "369"));
Request.setattribute ("UList", uList);

%>
${ulist[1].username}
${ulist[1].password}

Retrieving data in a JSP page with an El expression

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.