Getting a request URL in iFrame

Dear all,

I have a file containing an iframe such as this:

file1.jsp:<iframe src="http://mydomain.com/directory/file2.jsp">

In file2.jsp, I wish to get the url of the calling file (file1.jsp); e.g.

file2.jsp:request.getRequestURI();

However, that only returns "/directory/file2.jsp", i.e. the file itself.

Is there a way of solving this? I know it is possible to useparent.location.href in javascript, but would like to use JSP if possible.

Grateful for any thoughts!

/ Fred

[560 byte] By [fw9189a] at [2007-10-3 3:00:18]
# 1

> However, that only returns "/directory/file2.jsp",

> i.e. the file itself.

That's what it's supposed to do.

> Is there a way of solving this?

Solving what?

> I know it is possible

> to use parent.location.href in javascript, but

> would like to use JSP if possible.

Get the HTTP dereferrer header, it should contain the "from" info you seem to be looking for.

CeciNEstPasUnProgrammeura at 2007-7-14 20:49:53 > top of Java-index,Java Essentials,Java Programming...
# 2
You are of course correct. I am an idiot. No more coffee today.Enjoy the Duke Dollars.Cheers!
fw9189a at 2007-7-14 20:49:53 > top of Java-index,Java Essentials,Java Programming...