users@servlet-spec.java.net

[servlet-spec users] Javadoc for HttpServletRequest.getRequestURI() is wrong

From: Arend v. Reinersdorff <arend_at_arendvr.com>
Date: Sun, 20 Dec 2015 17:16:32 +0100

Hi,

the Javadoc for HttpServletRequest.getRequestURI() for Servlet 3.1
(unchanged in 4.0):
https://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getRequestURI--

The first line of Javadoc says:
"Returns the part of this request's URL from the __protocol name__ up to
the query string in the first line of the HTTP request"

And example:
First line of HTTP request="GET http://foo.bar/a.html HTTP/1.0"
Returned value="/a.html"


The example describes the actual behavior: The part of the request's URL
from the path name is returned, not from the protocol name.

Best regards,
Arend