• 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

No of Times a URL is Hit

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone

I looking of how to count the no hits my URL is having per day.

My application is purely struts based.

Please tell me a way or an idea .

I did little RND on interceptors but the problem to access my application i need to give the full URL. I mean if i give
http://localhost:10000/sandeep/sandy/Login.jsp only then i am able to access my application since it is pointing directly to the Jsp page not going to any action class file i am not able to keep a track of it .

please tell me ways in which i can keep a count the no of hits my URL is having per day

Looking forward for your reply
Thanks
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In servlets we can achieve this using filters in struts2 use interceptor.
 
m sandeep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI

thank you for your reply

Actaully the application Url as you can see hits driectly the jsp page instead of some action class so in this situation can you tell me how to use interceptors.

As far as i know interceptors can only be used before an action class is called or after an action class is called but in my application there is no action class called when the url is hit

thanks
 
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sandeep,

if the jsp page is hit, then i would suggest that use

in this way "hitcount" action will be invoked. Now use interceptor to meet your requirements.

hope this would help you.

 
m sandeep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you told that "if the jsp page is hit, then i would suggest that use
view plaincopy to clipboardprint?
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=hitcount">

in this way "hitcount" action will be invoked. Now use interceptor to meet your requirements. "

How would it call the struts-config.xml file to look for the hit count action class???

will this be an issue when the page is loaded i mean to say will this call interuption when there are too many users accessing the site

looking forward for your reply
thanks
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there,

ok i got it, you are not using struts2, so there is not point of using interceptors,
you can use filters for struts1.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic