Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider configuring UrlPathHelper with alwaysUseFullPath=true #21499

Closed
rstoyanchev opened this issue May 19, 2020 · 1 comment
Closed

Consider configuring UrlPathHelper with alwaysUseFullPath=true #21499

rstoyanchev opened this issue May 19, 2020 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented May 19, 2020

While working on spring-projects/spring-framework#25100 to optimize what UrlPathHelper does based on Servlet 4.0 runtime knowledge of the Servlet mapping type I realized that Spring Boot which I believe is aware of the DispatcherServlet mapping pattern, could use that knowledge to configure UrlPathHelper with alwaysUseFullPath=true.

This can be done if the Servlet mapping is "/", or "/*" which avoids unnecessary overhead to determine the servletPath as described in the referenced issue, essentially the same benefit that Servlet 4.0 HttpServletMapping brings but based on Boot's knowledge of the Servlet mapping instead. The only Servlet mapping type for which the servletPath must be determined is where there is a path prefix, e.g. "/myServlet/*" which is less common.

Keep in mind that HttpServletMapping is not supported everywhere, notably Jetty 9.x does not have Servlet 4.0 support, so this change should bring extra mileage there.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 19, 2020
@rstoyanchev
Copy link
Contributor Author

Actually it looks like since #13292, a "/*" mapping is not even allowed. So it's either default Servlet "/" or a path prefix mapping "/acme/*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants