tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: getting the full URL
Date Wed, 01 Nov 2006 15:10:21 GMT
Dan-
iterate thru all of the header variables and print the header variable..
<%
Enumeration headerNames = request.getHeaderNames();
while(headerNames.hasMoreElements()) 
{
String headerName = (String)headerNames.nextElement();
out.print("<TR><TD>" + headerName);
out.println(request.getHeader(headerName)+"</TD></TR>");
}
%>

Anyone else?
M-
This e-mail communication and any attachments may contain confidential and privileged information
for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified
that you have received
this communication in error and that any review, disclosure, dissemination, distribution or
copying of it or its 
contents
----- Original Message ----- 
From: "Daniel Blumenthal" <daniel@wordchamp.com>
To: "'Tomcat Users List'" <users@tomcat.apache.org>
Sent: Wednesday, November 01, 2006 8:37 AM
Subject: getting the full URL


> 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
>
Mime
View raw message