public java.lang.String getRequestURI() 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. The web container does not decode this String. For example: First line of HTTP request Returned Value POST /some/path.html HTTP/1.1 /some/path.html GET http://foo.bar/a.html HTTP/1.0 /a.html HEAD /xyz?a=b HTTP/1.1 /xyz why is it in second case it is just /a.html when it says from the protocol name up to the query string what is the difference between getRequestURI() vs getRequestURL() other than the returntype
I think the wording in the spec. isn't too clear. It should say "this method returns the URI path associated with the request" (taken from WROX Java Server Programming). So the protocol and the domain are not included in the return string.
Sun Certified J2EE Architect for the J2EE Platform (Part 1)<br />Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!