counting of no request to a jsp page

user is requesting a servlet and from there by many jsp pages are executing depending upon user input......i want to disply inthe jsp page like "thi is 76th request...".......how can i count.....
[202 byte] By [srikanth-pulicherlaa] at [2007-11-27 4:56:51]
# 1

1

2

3

4

5

gets boring but it works...

One way (and a very ugly one) is to keep a static variable that's increased with every request.

This of course doesn't scale at all, as it's reset when the application is reloaded and doesn't take things like clustering into account.

A better way is to store the count in a database that all instances connect to and that has a stored procedure or trigger to update the count.

jwentinga at 2007-7-12 10:12:10 > top of Java-index,Java Essentials,Java Programming...