Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

frame parent URL  RSS feed

 
Barry Higgins
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I have a jsp page sitting in a frame and am wondering if it is possible to access the parent frame's URL. This is also a jsp page and contains parameters which I need.
Thanks in advance.
Barry
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Barry,
This is really more of an HTML issue than a JSP one.

You can access all of the parent frame's properties with "window.parent."
[ June 13, 2005: Message edited by: Ben Souther ]
 
Barry Higgins
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Ben, but I working on the server side and need to access the URL to extract the parameters passed in the POST using the request.getParameter() method. That or at least gain access to it so I can parse it manually.
Thanks,
Barry
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frames, as far as the server is concerned, are just multiple requests, each with thier own response.

If you need to share variables accross requests, the most common way in J2EE is to store them in session.
 
Barry Higgins
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I forgot to mention I'm limited by the framework I'm working within that I have no access to the session. As far as I know I can't even use cookies.
I thought there might be some way of getting access to the browser and pulling the URL from that or some other hack but it sounds like I'll have to find another way around it.
Thanks,
Barry
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The parent frame holds the URL to the child frames.

You could append queryString variables to that URL.
You could then retrieve those values with request.getParameter.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Higgins:
I thought there might be some way of getting access to the browser and pulling the.....


One of the most useful tools for gaining an understanding of the browser/server relationship that I've ever seen is the
LiveHttpHeaders plugin for FireFox/Mozilla.

With it, you can see exactly what is sent to and from the browser when a request is made.

It's very useful for debugging as well.
 
Barry Higgins
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all your help Ben, I'll have a look at the plugin and if I find a way around it I'll post back.
Barry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!