what is the best way for creating a jsp visitor hit counters? is it better to use txt file and save the hit value into a file, or create a table in database??? or use session/cookie to count the users whom have visited the website?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That are a lot of questions. I’ll answer them separately.
A
Filterwhich listens on theurl-patternmatching the requests of interest. Maybe*.jsp?A database is definitely faster. If you don’t have or can’t afford one, then live with a text file. Be careful that you don’t save it inside the webapplication, but externally elsewhere on the local disk file system. Else it will get lost whenever you redeploy the webapplication.
Only use this to count the amount of user-specific visits during the user-specific session. Do not use this to count the sitewide amount of visits or whenever you care the cookie value to be manipulated.