aspose file tools*
The moose likes Servlets and the fly likes Trap a url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Trap a url" Watch "Trap a url" New topic
Author

Trap a url

Sanjay pts
Ranch Hand

Joined: Nov 07, 2000
Posts: 357
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


Eat JAVA, Drink JAVA, Sleep Java
Preethi M
Greenhorn

Joined: Oct 24, 2000
Posts: 22
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
 
subject: Trap a url