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...

2

1 Answer 1

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"/> 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.