You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Information that is commonly needed from HttpServletRequest is the URL or URI in its complete form. But currently, there is no such feature in Servlet, which raises a lot of questions for new developers, as is demonstrated in this highly voted Stackoverflow question.
The request-target in the HTTP RFC is the complete URI. URIs are specified in the origin-form.
The problem with Servlet is that the Servlet API doesn't provide this vital part of the HTTP request, but strips it down, and then provides parts of it separately. So users have to find methods to reconstruct it again back to it's original form, which can introduce bugs.
Users expect that the existing methods getRequestURI() and getRequestURL() provide what they are looking for, but then find that their application isn't behaving as expected, and have to resort to the JavaDocs to find out that these methods aren't providing complete information.
These problems would be solved if new methods with names like getCompleteRequestURI() or getFullRequestURI(), and getCompleteRequestURL() or getFullRequestURL(), would be added to HttpServletRequest.
The text was updated successfully, but these errors were encountered:
Information that is commonly needed from
HttpServletRequest
is the URL or URI in its complete form. But currently, there is no such feature in Servlet, which raises a lot of questions for new developers, as is demonstrated in this highly voted Stackoverflow question.The
request-target
in the HTTP RFC is the complete URI. URIs are specified in theorigin-form
.The problem with Servlet is that the Servlet API doesn't provide this vital part of the HTTP request, but strips it down, and then provides parts of it separately. So users have to find methods to reconstruct it again back to it's original form, which can introduce bugs.
Users expect that the existing methods
getRequestURI()
andgetRequestURL()
provide what they are looking for, but then find that their application isn't behaving as expected, and have to resort to the JavaDocs to find out that these methods aren't providing complete information.These problems would be solved if new methods with names like
getCompleteRequestURI()
orgetFullRequestURI()
, andgetCompleteRequestURL()
orgetFullRequestURL()
, would be added toHttpServletRequest
.The text was updated successfully, but these errors were encountered: