This example shows how to match multiple path segments by using regex in @Path template.
We can use regex [.+] or [.*] to match any characters in @Path (It is also referred as wildcard matching). That means, it will match all URIs. In following example we are matching anything between pathA and pathZ.
@ApplicationPath("/") public class MyRestApp extends Application { @Override public Set<Class<?>> getClasses() { return new HashSet<>(Arrays.asList(MyResource.class)); } }