Custom JSP taglib lets you request currency rates from ECB. The reference rates
are based on the regular daily concentration procedure between central banks within and outside the
European System of Central Banks, which normally takes place at 2.15 p.m. ECB time (CET). For example:
<%@ taglib uri="taglib.tld" prefix="r" %> <r:GetECBRates result="A"/> You car request historical rates (for the last 90 days). The attribute date sets date in format yyyy-mm-dd:
<%@ taglib uri="taglib.tld" prefix="r" %> <r:GetECBRates date="2014-06-25" result="A"/> Tag GetECBRates creates a page scope variable with results. And now you can examine
your results:
Time is <r:GetECBRatesTime result="A"/> RUB:<r:GetECBRate result="A" currency="RUB"/> USD:<r:GetECBRate result="A" currency="USD" id="B"/> <%=B%> and you will get some like this: Time is 2006-01-10 RUB:34.3800 USD:1.2064 Tag ForEachRate lets you iterate over returned data:
<r:ForEachRate result="A" id="var"> <br><%=var.getCurrency()%> : <%=var.getRate()%> </r:ForEachRate> The nested page scope variable described by the attribute id lets you request the following properties: String getCurrency() - returns a name
So you will get some like this:
BGN : 1.9559
Tags are: GetECBRates Body tag lets you perform a search via Google API. Parameters are: 1) result Describes a name for your page scope variable that will keep the results.
ForEachRate Body tag lets you iterate over returned data. Parameters are: 1) result Describes a name for your page scope variable that keeps the results.
GetECBRatesTime Tag lets you request a time. Parameters are: 1) result Describes your variable with requested results.
GetECBRate Tag lets you request a rate for the given currency. Parameters are: 1) result Describes your variable with requested results.
for downloading: Library: ecbratestag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|