Search code examples
javaservletsquery-stringhttp-request

Get parameter with the character '#' from a query string on java


I am trying to get a request string that has the character # and my parameter is got only until the #. But the thing is that I need to have this character, can't remove it.

Any idea?


Solution

  • Encode the # if it has to be there. A literal # indicates a fragment id and can't be used in a URI for any other purpose. w3schools has encoding tables so you can look up the values yourself, too.