title: How to test if <jsp:doBody/> is empty / null in a tag file?
body: <p>I discover jsp tags recently and use them to avoid duplication of common part of my views.</p>
  
  <p>So in my JSP views I have</p>
  
  <pre><code>&lt;web-component:mytag&gt;
  &lt;!-- HTML specific to that page --&gt;
  &lt;/web-component:mytag&gt;
  </code></pre>
  
  <p>And in my tag file I get the HTML with <code>&lt;jsp:doBody/&gt;</code>.</p>
  
  <p>My question is, how can I test if <code>&lt;jsp:doBody/&gt;</code> is empty so I can put a default HTML content?</p>
  
  <p>Something like</p>
  
  <pre><code>&lt;c:choose&gt;
      &lt;c:when test="${!doBody.empty}"&gt;
          &lt;jsp:doBody/&gt;
      &lt;/c:when&gt;
      &lt;c:otherwise&gt;
      &lt;!-- My default HTML content here --&gt;
      &lt;/c:otherwise&gt;
  &lt;/c:choose&gt;
  </code></pre>
  
  <p>So I'm looking for the correct expression insted of <code>doBody.empty</code></p>
  
  <p>Thanks in advance.</p>