Your parameters will need to be encoded if they contain any control characters.
The browser will do this for you if they are the result of a form submission.
If you're passing them by building up query strings, you would need to make sure they are properly escaped.
http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLEncoder.html