0

I'm trying to get the request's path with unresolved path variables in a WebFilter. I know in SpringBoot Servlet version it is possible to do this by getting request's attribute with key org.springframework.web.servlet.View.pathVariables. Although it seems no attribute is populated in WebFlux regarding that. Is there anyway to do this in a filter?

chriptus13
  • 705
  • 7
  • 20

1 Answers1

0

WebFlux version of org.springframework.web.servlet.View.pathVariables is org.springframework.web.reactive.HandlerMapping.bestMatchingPattern.

We can obtain it by doing

exchange.attributes[HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE]
chriptus13
  • 705
  • 7
  • 20