• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

number of users online

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to find the numbers of users accessing the static webpage, I dont have any sessions in my site, All are simple html static pages. Is there any way to identify this using Javascript
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript runs on the client, so it can't help with this.

You don't need sessions to keep track of page hits. You could use a servlet filter that stores page hits in a Map (URL -> number of hits) that's stored in the web app context.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,


HTML static page not contains any dynamic data and using java script you can not count user which are access your application.

You have to use some server side technology for support your requirement.

 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meet Gaurav wrote:How to find the numbers of users accessing the static webpage, I dont have any sessions in my site, All are simple html static pages. Is there any way to identify this using Javascript

You should be able to parse the information from the server log files. Now depending on what is your definition of "accessing" (i.e. last serving page is within 5 mins), you can calculate the number.
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duc Vo wrote:
You should be able to parse the information from the server log files. Now depending on what is your definition of "accessing" (i.e. last serving page is within 5 mins), you can calculate the number.


Hey, Why one has to parse the logs to get the user count??
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Inayath wrote:
Hey, Why one has to parse the logs to get the user count??

When one doesn't want to or have any appserver technology running. Btw, what problem are you trying to solve and/or what solution are you offering?
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duc Vo wrote:
When one doesn't want to or have any appserver technology running. Btw, what problem are you trying to solve and/or what solution are you offering?


I believe the question is to count the number of users who are online using javascript?

For which answer is NO.

Possible solution could be done on the serverside using either the Filter or the SessionListener.

Again, if these options are available why one has to parsing the logs



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic