0

i have an URL in my application, tes/{name}

i want to pass "this%string" to the path variable. so the URL will be tes/this%string but java changes that into another string because i pass symbol.

i need that percent symbol to process the data in the business class.

how can i pass percent symbol into the URL?

thank you.

Vodka
  • 113
  • 2
  • 10
  • Why don't you use Java Url encoding when passing the path variable from client and once it reaches the controller use Url decoding to preserve the % symbol. – ThivankaW Jun 07 '21 at 19:48
  • you mean from the front end? no i cant. the client want it that way. @ThivankaW – Vodka Jun 07 '21 at 20:04
  • The URL bar can only accommodate a limited number of characters. in order for you to not loose them or get them translated to something else you need to preserve them while its transmitted through the network channel. read this article to get a better understanding -> https://www.baeldung.com/java-url-encoding-decoding – ThivankaW Jun 08 '21 at 06:57
  • Refer this question to encode URL from client side app logic (frontend logic) -> https://stackoverflow.com/questions/332872/encode-url-in-javascript – ThivankaW Jun 08 '21 at 07:14

0 Answers0