0

@Path("/{code:.+}") public Response getTemplateForCode(@PathParam("code") String code)

I want to pass URI in path parameter eg(ABC://HELLO). But iam getting only single slash ABC:/HELLO only. Can anyone tell how to get double slashes with full uri ABC://HELLO. Is there any REGEX to get double slashes?

I don't want to pass in query params

John
  • 1
  • 1
    Does this answer your question? [How to percent encode in Java?](https://stackoverflow.com/questions/27220327/how-to-percent-encode-in-java) – collapsar May 02 '22 at 14:19
  • If a double slash gives a single slash then try 3 or 4 to see how it comes out of the parser. There is always a solution. –  May 02 '22 at 14:28
  • @Kendle regardless of passing number of slashes it always get single slashes. Is there any Regex to allow double slashes ? – John May 03 '22 at 17:36

1 Answers1

0

In Java regex we can use a backslash to escape the special meaning of a slash.
The pattern

\w+:\/\/\w+

matches

ABC://HELLO

See https://regex101.com/r/5vRHHN/1