title: Conditionally include a JSP .tag file?
body: <p>Been trying to look for an answer on the web, but couldn't find it.
  I have a jsp page calling a tag file (below), and inside this tag file, I need to conditionally call another tag file. However, the content is include no matter what value I passed through <strong>$loadScript</strong>.</p>
  
  <p>In my jsp page, I pass in the value of <strong>loadScript</strong>: (updated)</p>
  
  <pre><code>&lt;jsp:attribute name="loadScript"&gt;false&lt;/jsp:attribute&gt;
  </code></pre>
  
  <p>This is what's in my tag file:</p>
  
  <pre><code>&lt;%@tag description="put the tag description here" pageEncoding="UTF-8"%&gt;
  &lt;%@ attribute name="loadScript"%&gt;
  &lt;%@ taglib tagdir="/WEB-INF/tags" prefix="main" %&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;c:if test="${loadScript == 'true'}"&gt;
      &lt;main:script&gt;&lt;/main:script&gt;  
  &lt;/c:if&gt;
  
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What is the proper way to conditionally call/include a tag file?</p>
  
  <p>update:
  Yes, I can confirm the value had successfully transferred using this test:</p>
  
  <pre><code>&lt;c:if test="${'loadScript'}"&gt;
      &lt;script type="text/javascript"&gt;
          alert(${loadScript});
      &lt;/script&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>It looks like <code>&lt;main:script&gt;&lt;/main:script&gt;</code> tag would get generate no matter what?</p>