Custom JSP taglib lets you deploy Yahoo search API right in your JSP pages.
Tags are using Yahoo's API for search and let you provide a customized output. For example the following code performs a search
for Coldtags suite via Yahoo.
<%@ taglib uri="taglib.tld" prefix="y" %> <y:YahooSearch query="Coldtags suite" appid="your_Yahoo_ID" result="A"/> By default tag uses a web search from Yahoo (http://api.search.yahoo.com/WebSearchService/V1/webSearch).
You can use also the following URL's:
Tag YahooSearch creates a page scope variable with results. And now you can examine
your results:
Total available: <y:getTotalResultsAvailable result="A"/> <y:ForEachResult result="A" id="item"> <p>url=<%=item.getUrl()%> <%=var.getTitle()%> </y:ForEachResult> Tag ForEachResult iterates over returned records. The nested page scope variable described by the attribute id lets you request the following properties: getTitle() - title
Tags are: YahooSearch Body tag lets you perform a search via Yahoo API. Parameters are: 1) appid Optional parameter. Describes your application id from Yahoo.
ForEachResult Body tag lets you iterate over returned data. Parameters are: 1) result Describes a name for your page scope variable that keeps the results.
getTotalResultsAvailable Returns total available results. Parameters are: 1) result Describes a name for your page scope variable that keeps the results.
getTotalResultsReturned Prints returned results. Parameters are: 1) result Describes a name for your page scope variable that keeps the results.
getFirstResultPosition Prints a first position. Parameters are: 1) result Describes a name for your page scope variable that keeps the results.
for downloading: Library: yahoosearchtag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|