Hei. I am using the POST method for sending some information from a JSP to a Servlet. I cannot understand why when I send through the POST method a “+” character, it will be replace with a space character. Example: when I type the following String:
4+5 -> the Servlet will return 4 5; it replaces all the “+” signs. How can I fix this thing? I really need the “+” characters to be visible because after that I need to evaluate the expressions .
Hei. I am using the POST method for sending some information from a JSP
Share
Form variables are sent URL encoded. The “+” plus character is (one) URL encoding of a space.
See also:
AJAX POST and Plus Sign ( + ) — How to Encode?
If you want to send a literal plus sign, you would need to URL encode it either through Javascript or hard-coded “%2B”.