My .jsp pages all call the post method of a servlet. Here is the method's signature:
public void doPost(HttpServletRequest req, HttpServletResponse res)
My servlet needs to learn the caller's url. Several online sources suggest this approach:
String url="";
url=req.getRequestURL().toString();
Unfortunately that returns the *servlet's* url. I want the caller's url.
public void doPost(HttpServletRequest req, HttpServletResponse res)
My servlet needs to learn the caller's url. Several online sources suggest this approach:
String url="";
url=req.getRequestURL().toString();
Unfortunately that returns the *servlet's* url. I want the caller's url.