users@jsr311.java.net

Re: How to use regex pattern on url path and query params ?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 24 Mar 2010 16:30:44 -0400

On Mar 23, 2010, at 11:15 PM, Archer Yongjian Liu wrote:

> It seams that the specification has talked about that. But Could you give me a concrete example?
>
See the javadoc for @Path:

https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/Path.html

The regex only applies to path, not query parameters. E.g.:

@Path("a/{path: .*}")

would match:

a/b -> path="b"
a/b/c/d -> path="b/c/d"
a/c -> path="c"

etc.

Marc.