title: how to get values from an arraylist passed as a parameter in js function from jsp
body: <p>I have a called a <strong>Servlet</strong> and I am sending an <code>ArrayList</code> with request attribute from Servlet to JSP. I am calling a js function from the same JSP in which I am passing the <code>ArrayList</code> as a param to the js function. I want to retrieve the values from this <code>ArrayList</code>. </p>
  
  <p><strong>Code as follow:</strong></p>
  
  <pre><code>&lt;c:if test="${currentPage lt noOfPages}"&gt;   
      &lt;a onclick="OnNextButtonClick(${currentPage},'${al}');"&gt;
         &lt;Next&gt;
      &lt;/a&gt;
  &lt;/c:if&gt;   
     //Here al is the ArrayList
  
  &lt;script type="text/javascript"&gt; 
  function OnNextButtonClick(currentPage,al)
  {
    alert("current page == " + currentPage );
    alert("current page == " + al);
  
    var arr = new Array();
    var arr = al.split(','); 
    alert(arr);
  }
  </code></pre>
  
  <p>This arr is giving me values as follows:</p>
  
  <pre><code>[com.package@1def,com.package@fkbe23,com.package@546fhfg]
  </code></pre>
  
  <p>I want the values stored at this location. </p>
  
  <p>Can someone help me?</p>