Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confirmation About tag files inside jar

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we have to store tld files inside jar we have to store inside META-INF folder.
What if we store tag file inside jar?
should we store tag files inside META-INF folder inside jar.

Thanks
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we want to deploy tag files as jar then the tag file must be placed in under WEB-INF/tags directory or its Subdirectory

example:
/WEB-INF/tags/example.tag
/WEB-INF/tags/MyDirectory/example.tag

Then you have to create a tld file for that tag file.
The tld file must be placed under META-INF directory.
The tld file must use <tag-file> tag instead of <tag> tag.

example:

<taglib>

<uri>www.manning.com/scwcd/example</uri>
<tag-file>
<name>example</name>
<path>/META-INF/tags/example.tag</path>
</tag-file>
</taglib>

then make a jar file for that META-INF directory then place it in WEB-INF/lib directory
 
Arvind Giri
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A tag file can be placed anywhere in the jar. But it must have a tld, which should be there in META-INF or its sub-folder.
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SORRY IT WAS A MISTAKE. The above answer was wrong!
means use META-INF instead of WEB-INF
Here is the correct.

If we want to deploy tag files as jar then the tag file must be placed in under META-INF/tags directory or its Subdirectory

example:
/META-INF/tags/example.tag
/META-INF/tags/MyDirectory/example.tag

Then you have to create a tld file for that tag file.
The tld file must be placed under META-INF directory.
The tld file must use <tag-file> tag instead of <tag> tag.

example:

<taglib>

<uri>www.manning.com/scwcd/example</uri>
<tag-file>
<name>example</name>
<path>/META-INF/tags/example.tag</path>
</tag-file>
</taglib>

then make a jar file for that META-INF directory then place it in WEB-INF/lib directory
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Aravind Giri, i think you are wrong tag files must be place under META-INF/tags directory or its subdirctory for jar deployment.
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also think that tag files must go to tags or it's subdirectory.
 
Arvind Giri
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Guys! You are right!

I got confused with <path> element which requires full path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic