Thanks for helping out!
I'm using Tomcat 5,
Java 5. The code is part of a password recovery routine: I encode a piece of information in a
servlet, then put it in a URL I email to the user. When the user follows the URL, another servlet is run which checks the value.
In the first servlet, I encode the value like this:
String param = URLEncoder.encode(originalValue, "UTF-8");
Then I stick param into the URL I email to the user. When the user clicks the URL, the receiving servlet simply does a getParameter() to get the value back.
It seems pretty simple, but then I ran into the problem with "+". I tried setting request.setCharacterEncoding("UTF-8") at the first line in the servlet, but that didn't change anything. Maybe there's a method that returns the raw character string from the parameter (although the decoding may be done by Tomcat).
For now, my kludge solution is to check for a space, and replace it with a "+" -- of course, I'd rather get the decoding to work right. (For example, without a real solution I may discover that getParameter() decodes other characters to a space too.)