I think it is not possible to use this ant style in matching URLs as needed, because it will dwell on the next path separator character / .
I suggest you try 16.3.2.2. Regular expression URI patterns to display only the last part of the query (not tried this approach yet).
You can also match the rest of the query with PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE and apply some kind of expression there. Mark this post.
Otherwise, you must use query parameters to meet this condition 16.3.2.6. Request parameters and header values .
You can narrow down the matching of queries by using query parameter conditions such as "myParam", "! MyParam" or "myParam = myValue". The first two tests are for determining / the absence of query parameters, and the third is for a certain parameter value. Here is an example with a condition for the value of a query parameter.
In this case, you will display something like this using the options
@RequestMapping(value = {"/some/resource/**"}, params="somthing")
or use the annotation request parameter with an optional attribute in the method signature:
public void test(@RequestParam(value = "somthing", required=false) String str) {
source share