This tag used to create a loop over xml Documents this shows the value In which this is been implemented.


<?xml version="1.0" ?>

























<%@ taglib uri="" prefix="c" %>

<%@ taglib uri="" prefix="x" %>



          <title>&lt;x:forEach&gt;Tags In JSTL</title>



               <center><b><h3>Worker Info:</h3></b></center>

               <c:import url="workers.xml" var="lbr"/>

               <x:parse xml="${lbr}" var="disp"/>

        <ul class="list">

               <x:forEach select="$disp/workers/wrkr/name" var="prd">

                   <center><b><li>Name Of Workers :<x:out select="$prd" /></li></b></center>





      JSTL XML < x:forEach > Tag

This program defines the working procedure of forEach tag. This tag is used to create a loop over XML doc. This will shows the result according to implemented condition. The main attribute of this tag is var ‘variable name’ that will use to access the tag and will store the fetched value on web browser. Xml file reference also been used as mention above.  All the tags must be closed at last.                             

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular 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.