On the WebMvc side, the PathPattern's pattern string is made available as a request attribute:
|
request.setAttribute(BEST_MATCHING_PATTERN_ATTRIBUTE, bestPattern.getPatternString()); |
On the WebFlux side, the PathPattern itself is available:
|
exchange.getAttributes().put(BEST_MATCHING_PATTERN_ATTRIBUTE, pattern); |
Could a new attribute be introduced on the MVC side that exposes the PathPattern?
If we had the PathPattern on the MVC side, I think we could rework this WebMvc-based code in Boot to match more closely to its WebFlux-based equivalent.
On the WebMvc side, the
PathPattern's pattern string is made available as a request attribute:spring-framework/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.java
Line 174 in c1d4a76
On the WebFlux side, the
PathPatternitself is available:spring-framework/spring-webflux/src/main/java/org/springframework/web/reactive/handler/AbstractUrlHandlerMapping.java
Line 167 in c1d4a76
Could a new attribute be introduced on the MVC side that exposes the
PathPattern?If we had the
PathPatternon the MVC side, I think we could rework this WebMvc-based code in Boot to match more closely to its WebFlux-based equivalent.