title: How to implement some if-then logic with JSF and Facelets?
body: <p>I have a bean with field <code>status</code>. Depending on <code>status</code> value different css class should be applied to render it.</p>
  
  <p>So, I need something like this (very far from real things pseudocode):</p>
  
  <pre><code>if status == "Approved"
       cssClass = "green"
  if status == "Rejected"
       cssClass = "red"
  &lt;span class="cssClass"&gt;Some info&lt;/span&gt;
  </code></pre>
  
  <p>I tried to apply <code>jstl</code> but I can't make it work with facelets and jsf (but I heard that it is possible, maybe its truth). Here is the code:</p>
  
  <pre><code>&lt;c:choose&gt;
      &lt;c:when test="#{report.approved}"&gt;
          &lt;c:set var="statusClass" value="approved"/&gt;
      &lt;/c:when&gt;
      &lt;c:when test="#{report.rejected}"&gt;
          &lt;c:set var="statusClass" value="rejected"/&gt;
      &lt;/c:when&gt;
      &lt;c:when test="#{report.inProgress}"&gt;
          &lt;c:set var="statusClass" value="progress"/&gt;
      &lt;/c:when&gt;
      &lt;c:when test="#{report.pendingHR}"&gt;
          &lt;c:set var="statusClass" value="pending"/&gt;
      &lt;/c:when&gt;
  &lt;/c:choose&gt;
  &lt;span class="status ${statusClass}"&gt;#{report.formattedStatus}&lt;/span&gt;
  </code></pre>
  
  <p>How should it be done with JSF/Facelets?</p>