• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

number of users online

 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic