This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes How to maintain a counter in jsp to know how many times the page is visited? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "How to maintain a counter in jsp to know how many times the page is visited?" Watch "How to maintain a counter in jsp to know how many times the page is visited?" New topic
Author

How to maintain a counter in jsp to know how many times the page is visited?

ilias basha
Ranch Hand

Joined: Nov 27, 2008
Posts: 55

Hi,

I have a servlet code where an instance variable of Sevlet will be incremented each time the Servlet's service/doGet/doPost is invoked. By this way i am able to know how many times the partcular Servlet is requested..

here is code for the same.


My Question is now how to write a jsp which is exactly equivalent to the above given Servlet - specifically with respect to having an instance variable??
santosh dhulipala
Ranch Hand

Joined: Oct 21, 2010
Posts: 52

this can be done by putting the variable in application scope incrementing by geting the value from scope and restoring by which it can be accesed from jsp's hope i am correct


Thanks & Regards
Santosh Kumar.D

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to maintain a counter in jsp to know how many times the page is visited?
 
Similar Threads
problem while executing the JAR written using ANT
Display output in table
java don't compile my servlet.
How to call a servlet from a html
GET method working but POST method not working