This Function use to join all the array elements into String.

This function <fn:join> will join the array elements into a string. First we call the syntax library for accessing the JSTL. Then we declare the variables for storing the value that contained by variable. After in the body section we declare the function syntax that will use to execute while compiling and will present the output on the web browser.

fn:Join.jsp

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

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

<html>

   <head>

              <title>&lt;fn:Join&gt;In JSTL</title>

   </head>

   <body>

          <c:set var="str1" value="Java Server pages."/>

          <c:set var="str2" value="${fn:split(str1, ' ')}" />

          <c:set var="str3" value="${fn:join(str2, '-')}" />

          <br /><b><center><p>Real String : ${str3}</p>

   </body>

</html> 

        JSTL fn:join() Function





About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), 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.