Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:04:25+00:00 2026-06-04T00:04:25+00:00

I currently have my .tag files declared with: <%@taglib prefix=t tagdir=/WEB-INF/tags %> Example of

  • 0

I currently have my .tag files declared with:

<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>

Example of the path of a tag file :

/WEB-INF/tags/test.tag

And I use them like so :

<t:test oneAttributeKey="oneAttributeValue">
   some content...
</t:test>

My problem : I don’t want to put all my tag files in one single folder, “/WEB-INF/tags”.

I would prefere to have them in different subdirectories :

/WEB-INF/tags/users/

/WEB-INF/tags/widgetsA/

/WEB-INF/tags/widgetsB/

(…)

Is this possible, without creating a different taglib prefix for each and everyone of them?

Example of what I’d like to avoid :

<%@taglib prefix="t_users" tagdir="/WEB-INF/tags/users" %>
<%@taglib prefix="t_widgetsA" tagdir="/WEB-INF/tags/widgetsA" %>
<%@taglib prefix="t_widgetsB" tagdir="/WEB-INF/tags/widgetsB" %>

Example of what I would like, using a single “t” prefix :

<t:users/onetag oneAttributeKey="oneAttributeValue">
   some content...
</t:users/onetag>

Does a similar solution exist?

UPDATE : 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 anywhere except in the element that use them (ex: “<t:users/onetag”)!

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/!!

I want to be able to group the jsp and tag files into directories, depending of what they are related to! Example :

 /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

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:04:28+00:00Added an answer on June 4, 2026 at 12:04 am

    Define them as <tag-file> in a single .tld file which you put in /WEB-INF folder.

    E.g. /WEB-INF/my-tags.tld

    <?xml version="1.0" encoding="UTF-8" ?>
    <taglib 
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
        version="2.1"
    >    
        <display-name>My custom tags</display-name>    
        <tlib-version>1.0</tlib-version>
        <short-name>my</short-name>
        <uri>http://example.com/tags</uri>
    
        <tag-file>
            <name>foo</name>
            <path>/WEB-INF/tags/users/foo.tag</path>
        </tag-file>
    
        <tag-file>
            <name>bar</name>
            <path>/WEB-INF/tags/widgetsA/bar.tag</path>
        </tag-file>
    
        <tag-file>
            <name>baz</name>
            <path>/WEB-INF/tags/widgetsB/baz.tag</path>
        </tag-file>
    </taglib>
    

    Use it in your JSPs as follows

    <%@taglib prefix="my" uri="http://example.com/tags" %>
    ...
    <my:foo />
    <my:bar />
    <my:baz />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have the following code: Tag tag = getParent(); while(tag != null) {
I have many SWF file those I have included in my web page using
I currently have a url that looks like this: protocol://folder/file.js I can open this
I am currently writing a non-web program using mostly python and have gotten to
I currently have a program that finds and edits HTML files based on finding
I currently have page-specific javascript files that look something like: $(document).ready(function () { namespace.home.list
I have ini files that have comments in the but in one ini file
I currently have this as a search: <%= form_tag users_path, :controller => 'users', :action
I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --
Currently have password protection on my main and sub directories, however I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.