This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes How to trap the URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to trap the URL" Watch "How to trap the URL" New topic
Author

How to trap the URL

Rakesh Gadre
Ranch Hand

Joined: Feb 22, 2003
Posts: 47
Hello,
I am working in JSP. In an application, I am having Frameset with two rows. On the top frame, I am having HTML page and in the bottom frame I am displaying JSP page. Now in this JSP page, i want to trap the URL which is being shown in the addressbar. If I use request.getRequestURL(), I get the path for the jsp page. But, what I want is the path which is being displayed in the AddressBar of the browser.
Thanx in advance
Rakesh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

Using JavaScript you can get it via window.top.location. There's nothing in the request posted to the sub-frame that will allow you to get that info, so you'll need to get it on the client side and submit it through.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rakesh Gadre
Ranch Hand

Joined: Feb 22, 2003
Posts: 47
Thanx Bear,
Actually I have tried that option using JavaScript. But I want to do that using JSP. Will that be possible ?
Rakesh
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
How is the page that holds the Frameset being generated?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to trap the URL
 
Similar Threads
How to update the browser address with the displayed page
calling Action class from jsp frame
changing displayed text in addressbar,locationbar
retirving a value from query string
HTML Frames and JSP!