This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Tag file deployed in a JAR? 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Tag file deployed in a JAR?" Watch "Tag file deployed in a JAR?" New topic
Author

Tag file deployed in a JAR?

Aaron Raja
Ranch Hand

Joined: Jun 07, 2007
Posts: 206
As we know If the tag file is deployed in a JAR, there must be a TLD for the tag file.
can Some body give me one example please ?
AR


Thanks, AR
SCWCD 5, SCJP 1.4, OCA (PL/SQL)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Taken from here :


[My Blog]
All roads lead to JavaRanch
Goutam Chowdhury
Ranch Hand

Joined: Jan 20, 2009
Posts: 44
Its also help full



We have a tag file packaged in a JAR file in the /WEB-INF/lib directory. The path to the tag file inside the JAR is /META-INF/tags/myTag.tag.

<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/j2ee/web-jsptaglibrary_2_1.xsd" version="2.1">

<tlib-version>1.0</tlib-version>

<short-name>Hello</short-name>

<uri>http://com.sap.testExample/HelloSimpleTagFile</uri>

<tag-file>

<name>myTag</name>

<path>/META-INF/tags/myTag.tag</path>

</tag-file>

</taglib>




You create a JSP page, example.jsp, to use the tag and import the TLD. We can use one of the following ways:

● If you explicitly describe the tag files in a TLD, you use the uri attribute of the taglib directive to import the tags.

<%@ taglib prefix="my" uri=" http://com.sap.testExample/HelloSimpleTagFile " %>


● If you do not describe the tags in a TLD, you use the tagdir attribute of the taglib directive to import the tags.

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


To invoke the tag and specify its attributes:

<my:myTag bgcolor="#FF0000" title="myTable"/>



Goutam
SCJP 1.4 (86%)


Thanks And Regards
Goutam Chowdhury (Scjp1.4 86%,SCWCD5 94%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag file deployed in a JAR?
 
Similar Threads
TLD location?
Question on tag files?
java mail api
HFSJ Page No.501 - TagFiles
tag files JAR, there must be a tld