Jstl using and JSP how to traverse the list data passed over

Source: Internet
Author: User

Why learn to iterate through the data in a JSP ?

because the Request.setattribute ( ) method or otherwise, it often passes the list data to the JSP

See the picture for details

1.lib Import of Jstl.jar and standard.jar Packages

1.1 These two jar Package imports need to be added up

2.JSP inside import <%@ taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%>

2.1 prefix= "C" here this C can be changed to another letter

    1. Looping data with foreach

3.1 items= "${onelist}" means the value onelist represents key, and all data is taken out as list

3.2 var= "Customer" means that There is not a single data in the list

3.3 ${customer.id} means taking A value inside the customer, through ". "GET, you'll find Get/set method.

Jstl using and JSP how to traverse the list data passed over

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.