1

I build a rest API like www.example.com/checking/{id} and it works well. But when I passed in a id with slash, like abc/123, then the API path becomes the www.example.com/checking/abc/123 which actually breaks the path.

I can use the encoded URL id, like abc/123 encoded as abc%2F123, but it seems like when I use it to hit my API, it is hanging there, I can not find something in the log.

Is there any suggestion so that I can do this ? Is it a tomcat configuration issue or coding issue ?

Thanks,

Terry
  • 855
  • 4
  • 12
  • 16

2 Answers2

1

You have to use regex in your path, like this:

@Path("{name:.+}")
Alkanshel
  • 4,198
  • 1
  • 35
  • 54
0

Use the solutions posted in this tread and solve the problem.

Receive an HTTP 400 error if %2F is part of the GET URL in JBOSS

Community
  • 1
  • 1
Terry
  • 855
  • 4
  • 12
  • 16