Skip to content

String method for PatternsRequestCondition#getMatchingCondition [SPR-11484] #16109

@spring-projects-issues

Description

@spring-projects-issues

Christopher Smith opened SPR-11484 and commented

Spring HATEOAS provides a number of convenient reflective methods that will construct a resource URI by inspecting the controller handling a given resource type. I am trying to work on the reverse issue (finding the controller method that matches a particular URI), and the information I need appears to be in RequestMappingHandlerMapping, particularly in the composite PatternsRequestCondition.

However, PatternsRequestCondition only implements the interface getMatchingCondition, which requires an HttpServletRequest. Internally, it immediately extracts the path information from the request and inspects patterns for matches based on that string. It would be helpful for reflection tools to be able to call this method with just a String object, and it would be trivial to Extract Method on getMatchingCondition to add a getMatchingCondition(String) variant.


Affects: 4.0.2

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions