Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to trap the URL

 
Rakesh Gadre
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rakesh Gadre
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the page that holds the Frameset being generated?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic