Counter taglib ver. 1.7

    Custom JSP tag. Provides hits counter for your JSP pages.

For example:
 


<%@ taglib uri="taglib.tld" prefix="hit" %>

<!-- updates counter and prints its value -->
<hit:Counter />

<!-- updates counter and saves current value in the page scope variable -->
<hit:Counter id="A"/>
Hits:<%=A%>

Tags are:

Counter

Counting hits for your JSP page. Parameters are:

1) data Optional parameter. Describes path to file for data. By default this parameter is empty and tag will create own file for the each your page.
2) id Optional parameter. Describes a page scope variable for data (type is java.lang.String). Without this parameter tag just prints data.
3) session Optional parameter. Possible values are true or false. If this value is true, counter will be increased only once per session, otherwise it will be increased for the each page loading. Default value is false.
4) readOnly Optional parameter. Possible values are true or false. If this value is true, tag will only read the value. Default value is false.

ResetCounter

Resets counter for your JSP page. Parameters are:

1) data Optional parameter. Describes path to file for data. By default this parameter is empty (own counter file for the each page).
2) session Optional parameter. Possible values are true or false. Describes a scope for the counter. Default value is false (global level counter).
3) cond Optional parameter. Describes a boolean value tag's behavior depends on. Default value is true (reset counter).

for downloading:

Library: counttag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: