Getting current URL in java

This is a discussion on "Getting current URL in java" within the Other Programming Languages section. This forum, and the thread "Getting current URL in java are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 24th, 2006, 21:37
Up'n'Coming Member
Join Date: Aug 2006
Location: Peru
Age: 22
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Getting current URL in java

Hi everyone:
I'm trying to retrieve the current url from a page, but I can't seem to get it right. This is what happens, I have a jsp which calls a tag, within the Tag Handler I manage to get the request object from the jsp:

HttpServletRequest req=(HttpServletRequest) pageContext.getRequest();

Now, my problwm is that when I ask for the url:

String url=req.getRequestURL().toString();

But what I get is the url of the jsp instead of the url of the servlet that called the jsp(i.e. the url showed in the browser's navigation bar).

Any help will be greatfully recieved.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 27th, 2006, 02:37
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Getting current URL in java

You're looking for getRefererUrl.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 29th, 2006, 00:51
Up'n'Coming Member
Join Date: Aug 2006
Location: Peru
Age: 22
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Getting current URL in java

Well, I've been looking for getRefererUrl, but couldn't find it. I was hoping you could tell to wish class it belongs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 27th, 2007, 23:38
New Member
Join Date: Mar 2007
Location: Ireland
Age: 22
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Getting current URL in java

Code: Select all
Class XmlParserImageSearchResults.XmlParserImageSearchResult

Last edited by DeadCell; Mar 27th, 2007 at 23:39. Reason: typo :-\
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
jsp, tag, url

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current page problems unitedcraig Web Page Design 3 Jun 10th, 2008 20:44
Current Flash Competitiion Sgaspar11 Flash & Multimedia Forum 0 Aug 27th, 2007 19:36
Java/GUI/Server Developer (Java, EJB/Hibernate, SWING) - Berkshire Web JobBot Job Opportunities 0 Jan 16th, 2007 10:30
resizing current window with java danydrunk Other Programming Languages 2 Jul 12th, 2006 21:27


All times are GMT. The time now is 09:51.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved