Affects: \


I built a springboot 2.6.14 project with spring-web version 5.0.7.

In the project, I configured an AppWebServlet to map /app requests and an ApiWebServlet to map /api requests.

After compiling the project into war, it can run well in tomcat 9.x, but it fails to run under tomcat 8.5.43.

I checked the code org.springframework.web.util.ServletRequestPathUtils.ServletRequestPath#parse ,

it seems that there are differences in processing between servlet4.x and servlet3.x.

public static RequestPath parse(HttpServletRequest request) { String requestUri = (String) request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE); if (requestUri == null) { requestUri = request.getRequestURI(); } if (UrlPathHelper.servlet4Present) { String servletPathPrefix = Servlet4Delegate.getServletPathPrefix(request); if (StringUtils.hasText(servletPathPrefix)) { return new ServletRequestPath(requestUri, request.getContextPath(), servletPathPrefix); } } return new ServletRequestPath(requestUri, request.getContextPath(), request.getServletPath()); ---> change for this ? // return RequestPath.parse(requestUri, request.getContextPath()); }

Comment From: kiddingYang

[spring-web.zip](https://github.com/user-attachments/files/16529515/spring-web.zip)

add project

Comment From: snicoll

@kiddingYang neither Spring Boot 2.6.x, nor Spring Framework 5.0.x are supported anymore. You'll need to upgrade to a supported version but please ask this question on StackOverflow as it doesn't look like it's a candidate for this issue tracker.