I don't do JSP, but it sounds like you just need to encode your url. In Java, you can use the java.net.URLEncoder class, and invoke the encode() method on it.
Length wise, I don't believe that the HTTP specs limit the length of a field value. There is an overall limitation though when using GET, which I think is upwards of 65K characters (used to be low, like unsigned byte low).
header('HTTP/1.1 420 Enhance Your Calm');