wood burning stoves*
The moose likes JSP and the fly likes do I have to create a .jar for custom tag ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "do I have to create a .jar for custom tag ?" Watch "do I have to create a .jar for custom tag ?" New topic
Author

do I have to create a .jar for custom tag ?

Frank Sikuluzu
Ranch Hand

Joined: Dec 16, 2003
Posts: 116
I have created

1) WEB-INF/mytag.tld file
2) web.xml: <taglib-uri>/WEB-INF/mytag.tld</taglib-uri>
<taglib-location>/WEB-INF/mytag.tld</taglib-location>
3) test.jsp: <%@ taglib uri="/WEB-INF/mytag.tld" prefix="test" %>
4) WEB-INF/classes/MyTag.class

and it all works.

But some tutorials/books suggest we create a .jar file including the Tag handler classes, tld, and include the .jar in WEB-INF/lib/, after that for the "uri" part it can either directly points to that .jar or indirectly points to a symbolic name; similarly "taglib-location" can points to that .jar.

My question is -- Is it "required" to follow this step of creating a .jar for the custome tag ? What if I don't create a .jar in WEB-INF/lib ? What problem will my current setting (without a .jar)cause in a production environment ? Although I don't really see any problem with it, I want to confirm as I am not very familiar with custom tag stuff.
Frederic Filiatrault
Ranch Hand

Joined: Jul 12, 2004
Posts: 69
Hi,

As I experienced, it is only to be distributable. It doesn't affect anything.
But I might be wrong...


F.<br />SCJP, SCJD, SCWCD, SCBCD<br /> <br />Failure is not an option... It comes with the software bundle.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

Here's and excellent article by BrettMcLaughlin (O'Reilly) on why taglibs ought to be 'jarred' and how to go about it.

ram.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: do I have to create a .jar for custom tag ?
 
Similar Threads
taglib-directive tagdir and uri
taglibs distributed in jars
JWebPlus -Question ID :998318336796
no need for <taglib> tag in the web.xml
Implicit mapping of TLDs