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
Joined: Jul 02, 2001
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.
Joined: Nov 06, 2000
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