wood burning stoves
The moose likes Distributed Java and the fly likes reqest.getHeader(Referer) infomation lostin new window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "reqest.getHeader(Referer) infomation lostin new window" Watch "reqest.getHeader(Referer) infomation lostin new window" New topic

reqest.getHeader(Referer) infomation lostin new window

Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1864
Any one has any idea as to why the request.getHeader(Referer) info is lost when a page is opened in a new window.
It works fine when opened in the same window.
---HTML PAGE-----
<script language="Javascript">

function windowOpener(url,width,height,name,scrolls)
browserName = navigator.appName;
browserVer = navigator.appVersion.substring(0,1);
if (width==null) {width=417;}
if (height==null) {height=470;}
if (name==null) {name="globaltPopup";}
if (scrolls==true) {
else {
if (browserName != "Netscape" || browserVer != 2)
controlWindow=window.open(url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,scrollbars=" + scrollsOption + ",resizable=no");

window.name = "9kZF4Fw8lOLitrXrl9rcj3wbNLs2jg1qzrJsSIn2V078rOf5gjB4!1521296358!170405968!7501!7502";
<a href="javascript:windowOpener('http://localhost:7501/w/c/n', 417, 470,'note',true);">localhost new window </a>
<a href="http://localhost:7501/w/c/n">localhost new window </a>

<% String referer=request.getHeader("Referer");
System.out.println("domain 1 is :"+domain+":");
System.out.println("referer is :"+referer+":");
out.println("Request headers:");
Enumeration headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
System.out.println("IN HEADER NAMES");
String name = (String) headerNames.nextElement();
System.out.println("IN HEADER NAMES :"+name);
String value = request.getHeader(name);
System.out.println("IN HEADER NAMES :"+value);

if(referer!=null && referer.indexOf("club.nokia")!=-1){%>
if (window.opener)
window.opener.location = '<%=domain%>';
In the new window cases the referer header is null
But when opened in the same window the referer contains a vaild URL.
Any ideas
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1864
Please have this moved to JSP forum. Posted in the wrong forum!!!
I agree. Here's the link: http://aspose.com/file-tools
subject: reqest.getHeader(Referer) infomation lostin new window
It's not a secret anymore!