title: How can I access Java list elements from my client-side JavaScript code?
body: <p>I have the following simple script, which I am using to dynamically create the list elements in a <code>&lt;ul&gt;</code></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function generate(){
          var arr = new Array();
          &lt;c:forEach items="${articles}" var="a" varStatus="status"&gt;
              $('#listitems').append(
                  "&lt;li&gt;"+${a.title}+"&lt;/li&gt;"
              );
              arr[${status.index}] ="${a.slideShow.images}";
          &lt;/c:forEach&gt;
      }
  &lt;/script&gt; 
  </code></pre>
  
  <p>My problem stems from the images attribute. Every article has a slideshow and every slideshow has a list of images. I want to pull out the very first image from the list of images via the jave list.get(index); I want to do something like <strong>"${a.slideShow.images.get(0)}";</strong>. The get() is a java method from the list object. </p>
  
  <p>Any ideas?</p>