开发者

How to get previous URL?

开发者 https://www.devze.com 2023-03-27 05:52 出处:网络
I need the URL from wh开发者_JS百科ich my web app is called. For eg:- If there is a link to my site foo.com from stackoverflow.com, I need the stackoverflow link in web app(managed bean).

I need the URL from wh开发者_JS百科ich my web app is called. For eg:- If there is a link to my site foo.com from stackoverflow.com, I need the stackoverflow link in web app(managed bean).

All helps appreciated, thanks.


Not always filled, but you can use:

HttpServletRequest.getHeader("Referer");

Note: The spelling error is on purpose. For an explanation see here.


By checking the HTTP Referrer you can see from which site the request for your site originated.

0

精彩评论

暂无评论...
验证码 换一张
取 消