[英]JSP inside script tag | Find the URL of the file in which it is included
I have an html page ( http://www.somedomain.com/index.html ) which has contents like 我有一个html页面( http://www.somedomain.com/index.html ),其内容类似于
<html>
<head>
<script src="proxy.jsp"></script>
</head>
</html>
As you can see I have a JSP(proxy.jsp) that is included in this page within the script tag. 如您所见,此页面的script标记中包含一个JSP(proxy.jsp)。
Now inside my JSP (proxy.jsp) I would like to know the URL of the page in which this JSP is included inside a script tag which in this case is http://www.somedomain.com/index.html 现在,在我的JSP(proxy.jsp)内部,我想知道在脚本标记中包含此JSP的页面的URL,本例中为http://www.somedomain.com/index.html
Possible ? 有可能吗
I used request.getHeader("referer"); 我使用了request.getHeader(“ referer”); in proxy.jsp which gave me the url http://www.somedomain.com/index.html .
在proxy.jsp中,这给了我URL http://www.somedomain.com/index.html 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.