This wiki does not contain official documentation and is currently deprecated and read only. Please try reading the documentation on the Liferay Developer Network, the new site dedicated to Liferay documentation. DISCOVER Build your web site, collaborate with your colleagues, manage your content, and more. DEVELOP Build applications that run inside Liferay, extend the features provided out of the box with Liferay's APIs. DISTRIBUTE Let the world know about your app by publishing it in Liferay's marketplace. PARTICIPATE Become a part of Liferay's community, meet other Liferay users, and get involved in the open source project. How to search for a taglib's code
Table of Contents [-]
This page describes how to search for the code that implements a taglib that is being used in a JSP. Let's use the following as an example:
<liferay-ui:search-iterator searchContainer="<%= searchContainer %>" />
First break down the tag a little into its separate parts:
- liferay-ui
- search-iterator
- searchContainer
You can find the liferay-ui param with this path (version 4.2):
util-taglib/classes/META-INF/liferay-ui.tld
In liferay-ui.tld, search for search-iterator:
<tag>
<name>search-iterator</name>
<tagclass>com.liferay.taglib.ui.SearchIteratorTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>page</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>**searchContainer**</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>searchContainer is one of the attributes.
To find the path to the JSP, its stored in the tagclass.
<tagclass>com.liferay.taglib.ui.SearchIteratorTag</tagclass>
In the java class, you'll see a variable with the path to the JSP:
private static final String _PAGE = "/html/taglib/ui/search_iterator/page.jsp";
Another great way to do this is to use Javadoc. You can find the Javadoc API online in the developer section of the liferay site. Just choose the UTIL-TAGLIB sub project and browse the packages, till you find the tag you are looking for, Select it, then select the "View Source" link.
Additional Resources #
- Intro to Taglibs (overview of a very basic taglib): http://www.ibm.com/developerworks/java/library/j-jsp07233.html
- Taglib Tutorial: http://jakarta.apache.org/taglibs/tutorial.html