users@glassfish.java.net

Hit counter

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 Dec 2007 03:53:33 PST

I would be very grateful to know how to implement hit counters with JSF. I am putting together a website with three main pages, the first is basically an index page, then depending on which of two links are followed, you are taken to one of two pages containing large forms which have to be submitted. I would like to put a hit counter on all three pages, and possibly separate counters that record how many times the "submit" button has been clicked.

Rather than having three separate beans for each counter, it would make sense to have one bean that reads and updates one of three very small files that store the counter for the particular page. When the page loads, how do I tell the counter which file to read and update? Once I have the value from the counter, then it is just a matter of using the <h:outputText /> tag, but of course that tag has to be rendered after it has the value?

After the "submit" button is clicked, a quite separate counter can be updated, which should be much easier.

Many thanks for some help on this.

Christopher Sharp
[Message sent by forum member 'csharpdotcom' (csharpdotcom)]

http://forums.java.net/jive/thread.jspa?messageID=249480