URL redirection in Apache CXF JAX / RS call

How to make a jax / rs call with path parameters with a slash embedded in it?

@DELETE
@Path("/extended/universal/{CID}")
@Produces( { XML, JSON })
public Response deleteCID( @PathParam("CID") String cId ) throws Exception
{
}

Here {CID} contains a string sometimes like - urn: cid: URI: http://example.com: 80001 / index.html

I'm running out of ideas, intercepting and redirecting to a changed URL is not an option. Please let me know if Apache CXF provides any recommendations on this issue.

Thanks, Srikanth

+3
source share
1 answer

By default, path components do not write slashes. You can override this by explicitly providing a regex that says the fragment should match. In your case, use this path:

@Path("/extended/universal/{CID:.+}")

, CID. , + a *.

+1

Source: https://habr.com/ru/post/1791993/


All Articles