Custom JSP tags library lets you obtain weather information from Google service. E.g. the following
URL requests weather data for Moscow. Taglib lets
obtain XML data from Google, parse them and made them available for the application via plain JavaBean. For example:
<%@ taglib uri="taglib.tld" prefix="g" %> <g:GWeather id="A">Moscow</g:GWeather> <% java.util.Iterator it = A.iterator(); while (it.hasNext()) { com.cj.gweather.GoogleWeatherBean gb = (com.cj.gweather.GoogleWeatherBean)it.next(); %> <br/><%=(gb.getDayOfWeek()!=null)?gb.getDayOfWeek():"Today"%> <%=gb.getConditionData()%> <% } %> Taglib accepts a location (as tag's body or via attribute location) and creates ArrayList with data. The first element in this collection describes the current data, the following elements describes forecasts. JavaBean for data element provides the following methods:
Tags are: GWeather Body tag lets you collect weather data from Google. Tag's body describes a location. Attributes are: 1) location Optional attribute. Describes a location.
for downloading: Library: gweathertag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|