File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No of Times a URL is Hit

 
m sandeep
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In servlets we can achieve this using filters in struts2 use interceptor.
 
m sandeep
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic