tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid...@pidster.com>
Subject Re: getting the full URL
Date Wed, 01 Nov 2006 14:12:59 GMT
request.getRequestURL().toString();

getRequestURL is a StringBuffer of the full URL.



Daniel Blumenthal wrote:
> I'm trying to do what should be a fairly easy thing, but I'm really tearing
> my hair out over this...
> All I want is to be able to get the full URL (including scheme, queryString,
> etc.).  Right now, I'm trying something like:
>  
> <%
> out.write(request.getScheme() + ":/" +
> request.getRequestURI().replace("jsp","do") +
> (request.getQueryString().length() > 0 ? "?" + request.getQueryString() :
> ""));
> %>
>  
> It feels like this should be a simple, single call. Any takers?
>  
> Thanks!
> Daniel
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message