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
The default servlet is mapped using / as the url pattern. Per the spec (12.2):
A string containing only the ’/’ character indicates the “default” servlet of the
application. In this case the servlet path is the request URI minus the context path
and the path info is null
This means that if I hit a URL like http://domain.tld/hello, the requestURI is /hello. This is from the servlet path being /hello and the path info being null. This is unlike a servlet mapping of /*, which has an empty servlet path and /hello in the path info.
The end result is that the requestPath is parsed to / when hitting the route matcher, making it impossible to match anything.
It's not entirely clear to me what the best solution to this is. Perhaps one can infer that if path info is null, then the servlet has hit a perfect match, obviating the need for routing. If such routing exists anyway, it must be an error. Not sure if there are edge cases though.
A more brute solution, could be to have an overridable def isDefaultServlet: Boolean = false method.
The text was updated successfully, but these errors were encountered:
The default servlet is mapped using / as the url pattern. Per the spec (12.2):
A string containing only the
’/’
character indicates the “default” servlet of theapplication. In this case the servlet path is the request URI minus the context path
and the path info is null
This means that if I hit a URL like
http://domain.tld/hello
, the requestURI is/hello
. This is from the servlet path being /hello and the path info being null. This is unlike a servlet mapping of /*, which has an empty servlet path and /hello in the path info.The end result is that the requestPath is parsed to / when hitting the route matcher, making it impossible to match anything.
It's not entirely clear to me what the best solution to this is. Perhaps one can infer that if path info is null, then the servlet has hit a perfect match, obviating the need for routing. If such routing exists anyway, it must be an error. Not sure if there are edge cases though.
A more brute solution, could be to have an overridable
def isDefaultServlet: Boolean = false method
.The text was updated successfully, but these errors were encountered: