3

I have a spring based web application running on Apache Tomcat 7.0.39 and get request that contains parameter values having special characters (UTF-8 encoded).

For example:

street=R%C3%BCbenkamp+246

I need to pass this values to a DB lookup but first decode them. How shall I do it?

I tried:

URLDecoder.decode(street, "UTF-8");

but it seems that the value stays the same after decoding...

aviad
  • 8,229
  • 9
  • 50
  • 98

1 Answers1

3

The thing that really helped was modifying Tomcat server.xml and adding the URIEncoding="UTF-8" to the connector settings (my WS runs on port 8181)

<Connector connectionTimeout="20000" port="8181" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/> 
aviad
  • 8,229
  • 9
  • 50
  • 98