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

Trap a url

 
Sanjay pts
Ranch Hand
Posts: 357
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I want to find out how i can trap a url from which the user has come to my web-site.
Suppose there is some advertisement on the net on which if he clicks he will be directed to my web-site. now that ad may be on many web-sites, so how do i trap from which web-site he has clicked the ad and come to my web-site
Thanx.
Sanjay Patel
 
Preethi M
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjay!
I have a solution from which site the user actually clicked the ad.
public class test extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
String referer=req.getHeader("Referer");//the referer value will be ur required URL.
}
}
}
Hope this will help u.
REGARDS
Preethi M
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic