axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <>
Subject AxisServlet's using deprecated HttpUtils.getRequestURL
Date Thu, 20 Nov 2003 10:09:21 GMT
Let me introduce the following clause:

                // NOTE:  HttpUtils.getRequestURL has been deprecated.
                // This line SHOULD be:
                //    String url = req.getRequestURL().toString()
                // HOWEVER!!!!  DON'T REPLACE IT!  There's a bug in
                // req.getRequestURL that is not in HttpUtils.getRequestURL
                // req.getRequestURL returns "localhost" in the remote
                // scenario rather than the actual host name.
                // ? Still true?  For which JVM's?
                String url = HttpUtils.getRequestURL(request).toString();

One of my colleague researchers assured me that the server name is decided
by "Host" header of HTTP protocol (HTTP 1.1 requires that). For example,
Tomcat's implementation is

     * Return the buffer holding the server name, if
     * any. Use isNull() to check if there is no value
     * set.
     * This is the "virtual host", derived from the
     * Host: header.
    public MessageBytes serverName() {
	return serverNameMB;

Moreover, Tomcat's HttpUtils.getRequestURL(request) also finally uses the
above method, so it is clear that you get "localhost" in case your client
sends "Host: localhost" header even though the actual server name is not

I think this explanation is sufficient for rationale of updating
HttpUtils.getRequestURL(request) to req.getRequestURL(). In addition, WS-I
Basic Profile 1.0 also strongly recommends using HTTP 1.1, so the update
can increase users' understanding of how AxisServlet works in terms of host

Thanks for your opinion and feedback in advance,


Lee, Changshin (Korean name)
Ias (International name)
               Company Web Site:
               Personal Web Site:
Senior Researcher, Emerging Technology Evangelist & JCP Activities
JCP member -
R&D Institute
Tmax Soft, Inc. 
JCP member -

View raw message