title: Display Current Date as default in JSP
body: <p>I have a field in jsp page where user needs to put a date. I want to display the current date in dd/mm/yyyy format as default whe the page first loads. Of courese the user can change the date from current date to any date. I have written the following code for this.</p>
  
  <p></p>
  
  <pre><code>Date:
              &lt;s:textfield name="fromTransactionDate" label="fromTransactionDate" readonly="true" title="dd/mm/yyyy format" onclick="ds_sh(this);" value="&lt;%= new java.util.Date() %&gt;"/&gt;
                  &lt;/td&gt;
  </code></pre>
  
  <p>It gives the following error:</p>
  
  <pre><code>According to TLD or attribute directive in tag file, attribute value does not accept any expressions
  </code></pre>
  
  <p>Then I have imported the jar jstl-1.2.jar and add tag lib as</p>
  
  <pre><code>&lt;%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %&gt;
  </code></pre>
  
  <p>Now when I write <code>&lt;c:out value="&lt;%= new java.util.Date() %&gt;"&gt;&lt;/c:out&gt;</code> the date is displayed, but  for </p>
  
  <pre><code>&lt;s:textfield name="fromTransactionDate" label="fromTransactionDate" readonly="true" title="dd/mm/yyyy format" onclick="ds_sh(this);" value="&lt;%= new java.util.Date() %&gt;"/&gt;
  </code></pre>
  
  <p>the error is still coming. I am not sure how to write in  or  filed so that todays date is displayed and also user can change it to other date.
  Would really appreciate someone's advice.
  Thanks</p>