This tag use to set the variable attribute for initializing a value.



<?xml version="1.0" ?>
























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

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



                      <title>&lt;x:set&gt;Tag In JSTL</title>



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

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

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

                 <x:set var="nm" select="$disp//wrkr"/>

                      <center><b>The Age of the Third worker..

                 <c:out value="${nm}"/></b></center>



       JSTL XML < x:set > Tag

This program shows the use of set tag in this tag we set a var attribute used for variable name that will set a value for given condition. The main Attribute of this program is var ‘variable name’. The xml file also called named ‘workers.xml’. That will use to display the output on web browser.

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.