title: How to use if-else option in JSTL when the condition returned by javascript
body: <p>How to use if else in JSTL when the condition is a variable returned by javascript code</p>
  
  <p>I need to add some Tags HTML when the media is Tablet or ipad and another Tag Html otherwise.</p>
  
  <pre><code> &lt;c:choose&gt;
     &lt;c:when test="${TabletMedia}"&gt;
        // Tags HTML
     &lt;/c:when&gt;
  
     &lt;c:otherwise&gt;
       // other Tags HTML
     &lt;/c:otherwise&gt;
    &lt;/c:choose&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>function TabletteMedia() {
  
      if (navigator.userAgent.match(/(android|iphone|ipad|blackberry|symbian|symbianos|symbos|netfront|model-orange|javaplatform|iemobile|windows phone|samsung|htc|opera mobile|opera mobi|opera mini|presto|huawei|blazer|bolt|doris|fennec|gobrowser|iris|maemo browser|mib|cldc|minimo|semc-browser|skyfire|teashark|teleca|uzard|uzardweb|meego|nokia|bb10|playbook)/gi))
      {
          if (((screen.width &gt;= 480) &amp;&amp; (screen.height &gt;= 800)) || ((screen.width &gt;= 800) &amp;&amp; (screen.height &gt;= 480)) || navigator.userAgent.match(/ipad/gi))
          {
              return true;
          }
      }
      return false;
  
  }
  
  TabletMedia = TabletteMedia();
  </code></pre>