Re: counts the number of hit on a website containing many JSPs



Garg wrote:
Hi All,

I am having a scenario in which I am having a full public website,
which won't require any login. I want to count the number of hits to
that website.

like :
1.
count = 0
if i hit http://www.abc.com/xyz1.jsp then count should become 1
and if i hit on http://www.abc.com/xyz2.jsp then count should become 2
(I am writing these urls in the address bar and clicking enter)

2.
count=0
if I hit http://www.abc.com/xyz1.jsp then count should become 1 and
then if I navigate to http://www.abc.com/xyz2.jsp by clicking any
hyper link on xyz1.jsp file the count should remain 1

I this i don't want to put the code in every JSP. I need a common
place.

So please tell me where I should put my code and variable count.

Thanks in advance,
Tarun
If you are willing to create a session for all users irrespective of which URL they access, filters might help you. You can use a filter to intercept all requests (or only the ones you want included in the count), look at the session and figure out if this is a new user.
.



Relevant Pages

  • Re: counts the number of hit on a website containing many JSPs
    ... I am having a scenario in which I am having a full public website, ... which won't require any login. ... and if i hit on http://www.abc.com/xyz2.jsp then count should become 2 ...
    (comp.lang.java.programmer)
  • counts the number of hit on a website containing many JSPs
    ... I am having a scenario in which I am having a full public website, ... which won't require any login. ... and if i hit on http://www.abc.com/xyz2.jsp then count should become 2 ...
    (comp.lang.java.programmer)
  • Web site Admin problem in IIS console
    ... I have a public website on an sbs2003 machine which still works buy I can ... If I right click on the website name in IIS admin and go to 'Recalcualte ... or error untill I hit Stop on the IE tool Bar. ...
    (microsoft.public.windows.server.sbs)
  • Re: Business Objects and Session Variables
    ... The DB hit is not normally too bad on most modern networks. ... You can use Session to easily cache without building anything. ... ViewState (for the scope of a single page). ... > Storing everything in session may give you huge performance hits, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Incomlete object?
    ... have you tried commenting code and uncommenting until you hit the error. ... | I have a few classes, and I keep objects of those in session. ... | index.php -> class Page, starts session, in constructor inits database ... | point I get an error that it is incomplete (DB is stored in session as ...
    (alt.php)