Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting a request URL in iFrame

807569Aug 18 2006 — edited Aug 18 2006
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 use parent.location.href in javascript, but would like to use JSP if possible.

Grateful for any thoughts!

/ Fred
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2006
Added on Aug 18 2006
2 comments
271 views