cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <>
Subject Re: Thoughts on a data-driven web site
Date Fri, 23 Jun 2000 02:22:43 GMT
Jonathan Stimmel wrote:

> A related point: how can a taglib maintain state across all pages
> which use it? For instance, could you write a counter tag that would
> track how many times it was hit across all pages that reference it?
> I suppose you could store a field in a database somewhere, but a
> static variable in a class would be much cleaner. (Of course, I
> don't know why you'd want this particular function... =)

<xsl:stylesheet xmlns:...>
    <xsl:apply-templates select="@*"/>
        private static int counter = 0;
        private static synchronized int hitCount() {
          return ++counter;
. . .
<xsl:template match="hit-count">
. . . 

View raw message