http://stackoverflow.com/questions/2048121/url-matrix-parameters-vs-request-parameters
At first sight matrix params seem to have only advantages:
- more readable
- no encoding and decoding of "&" in XML documents is required
- URLs with "?" are not cached in many cases; URLs with matrix params are cached
- matrix parameters can appear everywhere in the path and are not limited to its end
- matrix parameters can have more than one value:
paramA=val1,val2
But there are also disadvantages:
- only a few frameworks like JAX-RS support matrix parameters
- When a browser submits a form via GET, the params become query params. So it ends up in two kinds of parameters for the same task. To not confuse users of the REST services and limit the effort for the developers of the services, it would be easier to use always query params - in this area.
The important difference is that matrix parameters apply to a particular path element while query parameters apply to the request as a whole. This comes into play when making a complex REST-style query to multiple levels of resources and sub-resources:
http://example.com/res/categories;name=foo/objects;name=green/?page=1
It really comes down to a matter of name-spacing. If only query parameters were used here, you would end up with parameters like "category_name" and "object_name" and you would lose the clarity added by the locality of the parameters within the request. In addition, when using a framework like JAX-RS, all the query parameters would show up within each resource handler, leading to potential conflicts and confusion.
http://stackoverflow.com/questions/401981/when-to-use-query-parameters-versus-matrix-parameters
http://web.archive.org/web/20130126100355/http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params
Intermediaries (proxies) won't cache any url with a query parameter in the url
As the web has matured the views of devs/admins are changing, the new versions of Squid will default to cache any urls with query parameters
http://www.java4s.com/web-services/restful-web-services-jax-rs-matrixparam-example/
http://localhost:2013/<projectRoot>/rest/customers;nameKey=Java4s;countryKey=USA
Here, the color attribute shows up twice: once with the model and once with the interior. Using @MatrixParam("color") in this case would be ambiguous and we would have to go back to processing PathSegments to obtain this matrix parameter.
http://www.w3.org/DesignIssues/MatrixURIs.html
http://web.archive.org/web/20080403063739/http://rest.blueoxen.net/cgi-bin/wiki.pl?PathsAndQueryStringshttp://www.w3.org/DesignIssues/MatrixURIs.html
https://jersey.java.net/documentation/latest/jaxrs-resources.html