How do I get the full url (as shown in the address bar) into my JSP page? I can use 'request.getRequestURI()' but that only show part of the URL. What if I want the full thing with http:// and ? parameters, etc. Thanks, Drew
Peter Kristensson
Ranch Hand
Joined: Jul 02, 2001
Posts: 118
posted
0
use the request.getRequestURL() instead (includes http://...../a.jsp or whatever) it returns a StringBuffer. Use request.getQueryString() to get the "a=101&b=202" parameter string.
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
request.getRequestURL() is available with the latest servlet/JSP API. If you are using an older version, you still have to use getRequestURI and just get the host out of the request.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley