title: <s:if> showing error while using JavaScript in JSP with Struts 2
body: <p><strong>My JSP code:</strong></p>
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
  &lt;s:if test=&quot;hasActionErrors()&quot;&gt;
         if ($(&quot;input[name=radio_workitem]:checked&quot;).length &gt; 0) {
              $(&quot;#id_div_workitem_detail&quot;).show();
          }
      &lt;/s:if&gt;
  &lt;/s:if&gt;
  </code></pre>
  <p>on <code>s:if</code>, JSP shows compile time error when hovering mouse on it (like spell error red line under <code>s:if</code>), shows msg <code>&quot;Syntax error on token &quot;if&quot;, ( expected after this token&quot;</code></p>
  <p>although this code works fine. No problem. <br></p>
  <p><strong>My questions are:</strong></p>
  <ol>
  <li>Why it shows error, although it works ?</li>
  <li>Is this good coding practice to write Struts tag in JavaScript ?</li>
  </ol>
  <p>I m using eclipse Luna IDE.</p>