Search

Chapter 7. @MatrixParam

download PDF
Matrix parameters are an arbitrary set of name-value pairs embedded in a URI path segment. An example of a matrix parameter is:

GET http://host.com/library/book;name=EJB 3.0;author=Bill Burke
Matrix parameters represent resources that can be addressed by their attributes as well as their raw ID. The @MatrixParam annotation lets you injext URI matrix parameters into your method invocation.

   @GET
   public String getBook(@MatrixParam("name") String name, @MatrixParam("author") String author) {...}
One limitation with @MatrixParam is that the current version of the specification does not resolve. If, for example, the same MatrixParam exists simultaneously in different path segments, at present we recommend using PathParam combined with PathSegment.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.