You are here:   HomeJava Server PagesJava Standard Tag Lib (JSTL)JSTL Core c forEach Tag

The Core tag <c: forEach> that Tag is casually known as the substitute of While, do While in java Statements. Its    also works as Loop instance with the form of scriptlet in Java Server pages.

This tag also use some attributes like begin, end or step while the procedure of looping in the sense..the begin   attribute will works as to from where the condition will start in the loop by default its 0 .the step will use to skip the number from one to other. And the END attribute will use to get ending the loop circle…

     <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

     <html>

       <head>

                 <title>&lt;c:forEach&gt;Tag Example in J.S.P</title>

       </head>

          <body>

                 <p><b><center>

                 <c:forEach var="seq" begin="2" end="20" step="2">

                              <c:out value="${seq}"/>

                 </c:forEach>

                 </center></b></p>

          </body>

     </html>

                                      JSTL Core c forEach Tag

 Let’s Descript About The <c: forEach> tag Program…

 As Mentioned Above we discuss about the tag that what it does and about its attributes. Now about to structure of program that how does the procedure goes on for executing the tag in proper way. Here we declare mandatory variable name and the value that is required for starting the loop here the other attribute we use step that will skip the number between sequences of loop. Then in last step we display the Output on web browser.





Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular





Search Content







Advance Courses



Basic Courses



Advertise with Us