title: radio button auto check based on condition using jstl
body: <p>i need to set the radio button as checked based on the value present in the request. below is the code i used in my JSP</p>
  
  <pre><code>&lt;input type="radio" name="status" id="status" value="Active" checked="&lt;c:if test="${posting.postingStatus eq 'Active'}"&gt;checked&lt;/c:if&gt;"&gt;
                  Active&amp;nbsp; 
  &lt;input type="radio" name="status" id="status" value="Closed" checked="&lt;c:if test="${posting.postingStatus eq 'Closed'}"&gt;checked&lt;/c:if&gt;"&gt;
                  Closed
  </code></pre>
  
  <p>I am getting the radiobutton along with the text 'checked/>Active' and another radio button with text 'checked/>Closed'</p>
  
  <p>i tried using another set of code</p>
  
  <pre><code>&lt;c:choose&gt;
      &lt;c:when test="${posting.postingStatus eq 'Active'}"&gt;
      &lt;input type="radio" name="status" id="status" value="Active" checked="checked"/&gt;
      Active&amp;nbsp; 
      &lt;input type="radio" name="status" id="status" value="Closed"/&gt;
      Closed
      &lt;/c:when&gt;
      &lt;c:otherwise&gt;
      &lt;input type="radio" name="status" id="status" value="Active" /&gt;
      Active&amp;nbsp;
      &lt;input type="radio" name="status" id="status" value="Closed" checked="checked"/&gt;
      Closed
      &lt;/c:otherwise&gt;
  </code></pre>
  
  <p></p>
  
  <p>i am getting double times with improper result.</p>
  
  <p>can anyone help me with this?</p>