The request parameter is like decrypt?param=5FHjiSJ6NOTmi7/+2tnnkQ==
.
In the servlet, when I try to print the parameter by String param = request.getParameter("param");
I get 5FHjiSJ6NOTmi7/ 2tnnkQ==
. It turns the character +
into a space. How can I keep the orginal paramter or how can I properly handle the character +
.
Besides, what else characters should I handle?
You have two choices
If you have control over the generation of the URL you should choose this. If not...
If you can't change how the URL is generated (above) then you can manually retrieve the raw URL. Certain methods decode parameters for you. getParameter
is one of them. On the other hand, getQueryString
does not decode the String. If you have only a few parameters it shouldn't be difficult to parse the value yourself.
request.getQueryString();
//?param=5FHjiSJ6NOTmi7/+2tnnkQ==
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With