This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes Grab the entire current URI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Grab the entire current URI" Watch "Grab the entire current URI" New topic
Author

Grab the entire current URI

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 823
Hi,
Can anyone tell me how I can grab the current entire URL using JSP? Thanks.

Rob
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Have you looked at HttpServletRequest.getRequestURL?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 823
Thanks for the reply. I'm far from a JSP developer or anything, would you happen to have a small piece of code to show how I grab the value in-line in a JSP file? Thanks again.

Rob
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 823
Never mind, duh. Thanks.

Rob
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Grab the entire current URI