This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Placing .tag files inside a jar file

 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we deploy a .tag file in a jar,we need to place the tld under meta-inf directory in jar.Where should the .tag file be placed?is that also need to be placed under meta-inf directory or outside like normal tag handlers?
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I got the answer for this its under META-INF\tags or any subdirectory of this
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again, Renu

First I would like to say that it is not mandatory to create a TLD file to declare custom tags built with tag file. It is legal to do so and special TLD tags were added in JSP v2.0 to accomodate tag files. However, tag files are essentially self-documenting with the use of the <%@ tag|attribute|variable %> directives.

If you put tag files is "well-known" locations within the webapp, then web container is responsible for finding the tag files directly.

JSP v2.0 spec, pg 1-176 (PDF pg 212):
Tag extensions written in JSP using tag files can be placed in one of two locations. The first possibility is in the/META-INF/tags/ directory (or a subdirectory of/META-INF/tags/) in a JAR file installed in the/WEB-INF/lib/ directory of the web application. Tags placed here are typically part of a reusable library of tags that can be easily dropped into any web application.

The second possibility is in the /WEB-INF/tags/ directory (or a subdirectory of /WEB-INF/tags/) of the web application. Tags placed here are within easy reach and require little packaging. Only files with a.tag or .tagx extension are recognized by the container to be tag files.

Tag files that appear in any other location are not considered tag extensions
and must be ignored by the JSP container. For example, a tag file that appears in
the root of a web application would be treated as content to be served.


This answers your second question about where tag files can be located.

HTH,
Bryan
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well explained Bryan.thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic