• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Need suggestions to count no of hits for Download link

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

I have an Download link in a jsp. My requirement is whenever user clicks on download link, before providing the download data,i have to track the no of hits.
We are having a 3rd party page tracking, which returns a 1*1 pixel image after tracking is done.

what i am doing is, i am forwarding the user to some redirection.jsp .
In that redirection.jsp, i am calling the 1*1 pixel image tag(3rd party page tracking by loading an image), after that i am redirecting the user to actual download link.
But what happening now is, request is redirecting before the 3rd party page tracking image is loaded.

Download Page (download.jsp)

Download Now


redirection.jsp

<image src="thirdpartyurl?parameters=xx" width="1" height="1" border="0" alt=""></image>
<%response.sendRedirect("actual download link");%>

Now I am thinking about getting the image loading status 200 or OK and after that i want to redirect the user to original download link.
If it is possibel how can i do it or any other suggestions without cookies concept.

After loading the page tracking image only, i have to redirect the user to original link.
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to use filters & keep track of count .
In filter set the count in context attribute so that you can that count from any page or servlet in application.

let me know if you have any quires.
 
No, tomorrow we rule the world! With this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic