0

我有一个页面http://localhost:4502/content/project/en/mypage.html,它有几个虚 URL 设置为

/content/project/vanity-1
/content/project/vanity-2

因此,来自上述两个虚 URL 的任何请求都将被重定向到/mypage.html

是否可以从页面重定向到的位置获取虚 URL 请求?即我怎样才能找到请求来自哪个虚 URL?

request.getRequestURL()给我 。./mypage.html但我需要获取虚 URL 请求。

4

2 回答 2

0

您应该尝试从/content/project/page/jcr:content属性中获取它sling:vanityPath

于 2015-08-19T12:05:50.203 回答
0

它在 HTTP 引用标头中可用。您可以按以下方式获取它:

String referrer = request.getHeader("referer"); 
于 2015-09-03T05:57:33.240 回答