aspose file tools*
The moose likes JSP and the fly likes How to know what tags are available in taglib and whats their behaviour ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to know what tags are available in taglib and whats their behaviour ?" Watch "How to know what tags are available in taglib and whats their behaviour ?" New topic
Author

How to know what tags are available in taglib and whats their behaviour ?

nirali shah
Greenhorn

Joined: Apr 16, 2009
Posts: 24
I have tomcat installed on my laptop. Now I am trying to understand taglib. So I checked almost all the folders under tomcat and found "jstl" in the following path
"C:\Program Files\apache-tomcat-5.5.27\webapps\jsp-examples\WEB-INF\lib"

jstl is jar file, I opened it with winzip and I found few classes organized in different folders placed in a hierarchy e.g. one class is "ConditionalTagSupport.class". Do these classes represent tags ? If yes then How to use these tags ? How do I know what does this tag do ?

If its not tags, then where can I find some sample tags ? Are there readymade tags library available or all the libraries are custom made by organizations ? Is it proprietory information ? Is there any sample tag library available to work with ?

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61008
    
  65

Perhaps you could check the JSTL Specification.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Definitely Google and check the JavaDocs for the JSTL taglibs.

But basically, here's how it works. A tag library provides a set of custom tags that perform some type of function. I just finished a blog about using some basic JSF tags in a simple web page.(My JSF Blog) Tags in a JSF page look like this:



Here you have an outputLink tag, an outputText tag and view tag. Now, those look like HTML/XML type elements, but they provide some logic and functionality, and that functionality is written in Java. So, while the developer who uses the tag is shielded from the implementation, the fact is, there is definitely a Java class somewhere that provides the implementation of those tags. So, yes, the code you saw in the JSTL library was probably the implementation of a particular tag. However, that's not where you want to go to find out about how to use the tag. As a web developer, you just want to focus on the tag.

-Cameron McKenzie

nirali shah
Greenhorn

Joined: Apr 16, 2009
Posts: 24
thanks. Thats the logic I was applying.

Question is, how do I know which tag does what ? If I want to use an API, I can refer to the documentation on java.sun.com and find the details of API. These APIs are available to anyone who wants to use it.

Where can I find documentation for the taglib ? Are they available to everyone ?
The tags you used in the example you gave, if I want to use those tags what do I need to do ?

I have no idea where to start from for the use of taglib. Can you please explain where to start ?

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61008
    
  65

nirali shah wrote:Where can I find documentation for the taglib ? Are they available to everyone ?

If you are asking specifically about the JSTL tags, then I've already told where to look for their documentation. For anybody else's tags, it's the responsibility of the author of the tag library to make documentation available.

A properly documented tag library (rare) can be passed through the tlddoc tool to produce Javadoc-like documentation from the documentation markup in the TLD file.

To learn how to write your own tags and libraries, start with the JSP Specification.
nirali shah
Greenhorn

Joined: Apr 16, 2009
Posts: 24
how to find what taglibs are made public by the author ? How to find them ? Is there any centralised store there to store the taglibs like APIs are available online through java.sun.com ?

You replied earlier to check JSTL sprcification. Can you please tell where and how ? Is there any command line tool to check jstl specification like javadoc ?

thanks
karan wadhwani
Greenhorn

Joined: Feb 22, 2005
Posts: 12
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl.html?page=1
nirali shah
Greenhorn

Joined: Apr 16, 2009
Posts: 24
I did visit the link provided by you, but I am still unable to figure out. That link directed to other link.

I visited java.sun.com. In that I looked for taglib and I found that java WSDP is having a taglib as a part of the package. Now this java WSDP and jdk are one and same or different ?

To download taglib alone, I visited brothersoft.com and downloaded a package from there. There were few tags like NextPageButtonTag, NewPaneTag etc. But I could not figure out how to use these tags. I could not find and specification document mentioning how to use these tags.

Can someone please provide detailed answer to my problem rather than being brief and directing to other sites please.

I visited http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl.html?page=1 , from there I clicked on the link "Download the JSTL archive", that directed me to "http://apache.towardex.com/jakarta/taglibs/standard/"
this page is not being displayed and gives error message "Internet Explorer can not display the webpage."

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61008
    
  65

You need to be more specific in your request. Are you looking for a JSTL implementation (I recommend Jakarta's), or other proprietary taglibs created by just about anyone?

If the latter, there's no central repository and there could literally be thousands upon thousands of custom taglibs.
nirali shah
Greenhorn

Joined: Apr 16, 2009
Posts: 24
I just need one to start work with. I did visit jakarta's page and downloaded from there. But there was no documentation of anykind. I have provided details below of my download.

this is what I see on jakarta's page

"Download a binary distribution of the Standard release:

Download the Standard Tag Library Release from an Apache Jakarta Project Mirror
Download the most recent, nightly snapshot:

Standard Taglib nightly snapshot
Nightly build distributions of the development version for all the Jakarta-Taglibs are available for download:

Download Jakarta-Taglibs Source
Download entire Jakarta-Taglibs Distribution "

which one do I download ? I tried one under that Apache Jakarta Project Mirror. Is that right one ?
Or shall I download Jakarta-Taglibs Source or Jakarta-Taglibs Distribution ?

Can you please provide exact path on jakarta's site, about from where to download and once downloaded what will be the path for specification.


thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61008
    
  65

The Standard Taglib is the JSTL implementation.

And for about the third time, the JSTL Specification is the documentation. You don't need to download any documentation from the Jakarta site.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to know what tags are available in taglib and whats their behaviour ?