@MatrixVariable and (encoded) slashes
Is there any way to configure mappings so that this works?
I have a controller with
Code:
@RequestMapping(value="data{filter}", method=GET)
public ResponseEntity<Data> getData(@MatrixVariable String title, @RequestParam int page) {
// ...
}
and http://localhost/servlet/data;title=a?page=0 correctly maps to the controller and sets title to "a".
However I would like it to work when the title contains slashes, in such a way that
http://localhost/servlet/data;title=a%2fb?page=0 maps to this controller and title is set to "a/b".
With the default configuration the URL is decoded before mapping so Spring tries to find a controller for data;title=a/b?page=0 and obviously fails.
I thought that with https://jira.springsource.org/browse/SPR-9098 I can just set urlDecode to false and be happy.
But this does not work either, with the quite surprising error "org.springframework.web.bind.ServletRequestBindin gException: Missing matrix variable 'title' for method parameter type [java.lang.String]" (only for the "title="a%2fb" case, "title=a" works as before).