Whoops, be careful with those two methods.
static String java.net.URLEncoder.encode(String s) is what changes spaces to %20
HttpServletResponse.encodeURL(String in) will perform URL re-writing. Which , by the way, you should ALSO do. And, if you use this method, you should encode the *entire* URL.
But another way to fix this (well, it would involve a bit more... but why not use agency id, instead of agency name? But this is maybe stepping into the 'data domain'. Whatever.