title: How to make JSP input checkbox checked by default?
body: <p>I have a checkbox in JSP, which consists of a <code>HashMap&lt;String, String&gt;</code>, e.g.,</p>
  <pre><code>&quot;1&quot;, &quot;Name&quot;
  &quot;2&quot;, &quot;Age&quot;
  &quot;3&quot;, &quot;Gender&quot;
  </code></pre>
  <p>Now I want the first entry be checked by default, how should I write the <code>if test</code> code? The current code is as follows:</p>
  <pre><code>&lt;input type=&quot;checkbox&quot; name=&quot;params&quot; value=&quot;&lt;s:property value=&quot;#param.key&quot;/&gt;&quot;
  &lt;s:iterator value=&quot;params&quot; var=&quot;app&quot;&gt;
  &lt;s:if test=&quot;???&quot;&gt;
  onclick=&quot;return false&quot;
  checked=&quot;checked&quot;
  &lt;/s:if&gt;
  &lt;/s:iterator&gt;/&gt;
  &amp;emsp;&lt;s:property value=&quot;#param.value&quot;/&gt;
  </code></pre>