jps26401
Apr 25th, 2007, 10:28 AM
Hi all,
I need to transfer non-ASCII characters in URI (I implement POST/REDIRECT/GET pattern).
First controller redirects via GET to other one like follows:
Map<String, Object> model = new HashMap<String, Object>();
model.put("name", URLEncoder.encode(search.getName(), "UTF-8"));
return new ModelAndView(new RedirectView(getSuccessView()), model);
Second controller decode it like follows:
search.setName(URLDecoder.decode(search.getName(), "UTF-8"))
It's working on localhost (Win OS, Tomcat 5.5.17), it's working on our test server (Linux, Tomcat 5.5.17) but it's not working at our customer (Linux, Tomcat 5.5.20, https, proxy server). I test other application at our customer (without Spring and also transfer non-ASCII characters via URI) and it's working correctly.
Example:
name = "zámek" => ?name=z%C3%A1mek (it's correct)
but when call it at our customer it generates ?name=z%2525C3%2525A1mek as URI parameter. It replaces % with %25 and then I can't decode it. Why this is happening?
I also used base64 to avoid these problems but it was the same problem with replacing %.
I would very appreciate any help.
Thank you in advance,
PETER
I need to transfer non-ASCII characters in URI (I implement POST/REDIRECT/GET pattern).
First controller redirects via GET to other one like follows:
Map<String, Object> model = new HashMap<String, Object>();
model.put("name", URLEncoder.encode(search.getName(), "UTF-8"));
return new ModelAndView(new RedirectView(getSuccessView()), model);
Second controller decode it like follows:
search.setName(URLDecoder.decode(search.getName(), "UTF-8"))
It's working on localhost (Win OS, Tomcat 5.5.17), it's working on our test server (Linux, Tomcat 5.5.17) but it's not working at our customer (Linux, Tomcat 5.5.20, https, proxy server). I test other application at our customer (without Spring and also transfer non-ASCII characters via URI) and it's working correctly.
Example:
name = "zámek" => ?name=z%C3%A1mek (it's correct)
but when call it at our customer it generates ?name=z%2525C3%2525A1mek as URI parameter. It replaces % with %25 and then I can't decode it. Why this is happening?
I also used base64 to avoid these problems but it was the same problem with replacing %.
I would very appreciate any help.
Thank you in advance,
PETER