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

How do you get the url?  RSS feed

 
Matt Williams
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get the full url of the page that I am on to do some dynamic menu generation and I can't seem to figure out how to do this. Is there a simple command?
Thanks in advance,
Matt
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

not sure I get what you want....
do you want to create a new URL obj? OR
do you want to get the full URL from a
request obj of a Servlet/JSP?
could you pl clarify?
regds.
- satya
 
Matt Williams
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to get the full url from the jsp. For example if I were on this page I would want to be able to get:
http://www.javaranch.com/ubb/Forum7/HTML/005895.html
Thanks,
Matt
 
Matt Williams
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I guess I figured it out.
<%= request.getRequestURI() %>
Thanks for the help though.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

ummm...you could use that method.
However, you might want to read thru this documentation.
Seems that there will be a difference in get and post requests.
Not sure if this is what you are looking for?
Alternatively, you could use:
java.lang.String)" TARGET=_blank rel="nofollow">request.getHeader("Referer");
regds.
- satya
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!