Spaces in URIs are allowed if they’re encoded, as discussed here. JAX-RS (Jersey on Payara) doesn’t seem to allow spaces defined in the path regex pattern. The above regex should match the encoded ABC%20XYZ, but it doesn’t. Request: Internally, Payara throws a 404: Removing %20 (space) succeeds. In JAX-RS Spec 2.1 Final, section 3.3.2 Parameters, it states you have to