title: How to execute a javascript inside a Struts2 iterator?
body: <p>I'm developing a shopping web site application. In my application clients can watch the daily offers. I have a table named offer in database. I'm using Struts2 framework. I have an action class named, <code>OfferView.java</code>. In this class I'm adding all offers' end dates to a List.(<code>List&lt;String[]&gt;</code>). My purpose is, I need to run a countdown timer according to the end date of every offer. In my view, I tried to run a javascript inside Struts2 iterator. But I failed. For the countdown timer I'm using <code>jquery.countdown.js</code>. I tried with this-</p>
  
  <pre><code>&lt;s:iterator value="days"&gt;
      &lt;script type="text/javascript"&gt;
          $(function () {
             var day ='&lt;s:property value="days[0]"/&gt;';
             var austDay = new Date();
             austDay = new Date(day+1, - 1, 25);
             $('#defaultCountdown').countdown({until: austDay});
             $('#year').text(austDay.getFullYear());
          });
      &lt;/script&gt;
   &lt;/s:iterator&gt;
  </code></pre>
  
  <p>This iterator is working. When I'm adding <code>&lt;s:property value="days[0]"/&gt;</code> outside the script it's working well. How could I run a javascript inside an iterator? Is it possible, If it is how to do it?</p>