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.
|
|
|
|
|
![]() |
||
Getting current URL in java
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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. |
|
|
|
#2
|
|||
|
|||
|
Re: Getting current URL in java
You're looking for getRefererUrl.
|
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
Re: Getting current URL in java
Last edited by DeadCell; Mar 27th, 2007 at 23:39. Reason: typo :-\ |
![]() |
| Tags |
| jsp, tag, url |
| Thread Tools | |
|
|
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 |