Thursday, June 16, 2016

How to get the referred/called url

I want to find the URL from which my page is called or from which my page is redirected. The example is given below.


Example
@InjectObject(value = "service:tapestry.globals.RequestGlobals")
public abstract RequestGlobals getRequestGlobals();

HttpServletRequest httpServletRequest = requestGlobals.getRequest();
String referrer =httpServletRequest.getHeader("referer");

No comments: