How to get name-value pairs(Matrix Variable) in path segments in Spring webflux service using Handler

Viewed 79

How to get name-value pairs(Matrix Variable) in path segments in Spring webflux service using Handler ?

Sample Endpoint Which I want to expose https://www.myservice.com/myresource/a/b;size=100;

In Controller based approach we can get it using @MatrixVariable @MatrixVariable(name="size", pathVar="b")

How can we get the value in case of we want to use Router and Handler (Functional Endpoint) instead of Controller ?

public Mono<ServerResponse> myHandler(ServerRequest request) {

//TODO get size value

}

In the controller based approach it is very easy to get these values. I am unable to find a way to get this in Handler based approach.

Searched https://spring.getdocs.org/en-US/spring-framework-docs/docs/spring-web-reactive/webflux/webflux-controller.html but Found a dead link -> https://spring.getdocs.org/en-US/spring-framework-docs/docs/spring-web-reactive/webflux/webflux-controller.html#webflux:webflux-controller:webflux-ann-methods.adoc#webflux-ann-matrix-variables

0 Answers
Related