title: JSP Tag Files in subdirectories, using a single taglib prefix. Is that possible?
body: <p>I currently have my .tag files declared with:</p>
  
  <pre><code>&lt;%@taglib prefix="t" tagdir="/WEB-INF/tags" %&gt;
  </code></pre>
  
  <p>Example of the path of a tag file :</p>
  
  <pre><code>/WEB-INF/tags/test.tag
  </code></pre>
  
  <p>And I use them like so :</p>
  
  <pre><code>&lt;t:test oneAttributeKey="oneAttributeValue"&gt;
     some content...
  &lt;/t:test&gt;
  </code></pre>
  
  <p><strong>My problem</strong> : I don't want to put all my tag files in <em>one single</em> folder, "/WEB-INF/tags". </p>
  
  <p>I would prefere to have them in different subdirectories :</p>
  
  <p>/WEB-INF/tags/users/</p>
  
  <p>/WEB-INF/tags/widgetsA/</p>
  
  <p>/WEB-INF/tags/widgetsB/</p>
  
  <p>(...)</p>
  
  <p>Is this possible, <em>without creating a different taglib prefix for each and everyone of them</em>? </p>
  
  <p>Example of what I'd like to avoid :</p>
  
  <pre><code>&lt;%@taglib prefix="t_users" tagdir="/WEB-INF/tags/users" %&gt;
  &lt;%@taglib prefix="t_widgetsA" tagdir="/WEB-INF/tags/widgetsA" %&gt;
  &lt;%@taglib prefix="t_widgetsB" tagdir="/WEB-INF/tags/widgetsB" %&gt;
  </code></pre>
  
  <p>Example of what I would like, using a single "t" prefix :</p>
  
  <pre><code>&lt;t:users/onetag oneAttributeKey="oneAttributeValue"&gt;
     some content...
  &lt;/t:users/onetag&gt;
  </code></pre>
  
  <p>Does a similar solution exist?</p>
  
  <p><strong>UPDATE</strong> : BalusC showed it's possible to use one prefix only, by defining all the tag files in a single .tld. I guess my question was not clear enough then : I'd like to know if it's possible to use the tag files in multiple subdirectories, without having to specify a path to each of them <em>anywhere</em> except in the element that use them (ex: "&lt;t:users/onetag")!</p>
  
  <p>What I do not like about JSP Tags is that they act very differently than regular JSP files, even if they actually share very similar content. In fact, I even decided to put all my jsp files inside the /WEB-INF/tags/ folder, so they are side to side with the tag files (I had to choose /WEB-INF/tags/ for that, since this folder is mandatory for the tag files, for some reason)! I don't understand why some of my files containing HTML would go in /WEB-INF/jsp/ and some others in /WEB-INF/tags/!!</p>
  
  <p>I want to be able to <em>group</em> the jsp and tag files into directories, depending of what they are related to! Example :</p>
  
  <pre><code> /WEB-INF/tags/users/userProfileLayout.tag
   /WEB-INF/tags/users/employeeProfile.jsp
   /WEB-INF/tags/users/employerProfile.jsp
  
   /WEB-INF/tags/widgetsA/widgetALayout.tag
   /WEB-INF/tags/widgetsA/oldWidgetA.jsp
   /WEB-INF/tags/widgetsA/newWidgetA.jsp
  </code></pre>
  
  <p>But this forces me to declare the path of each of the subdirectories, in multiple @tablib or in a .tld, which I find a little bit inconvenient. I'll live with it, but I think it could be improved.</p>