I\'ve some issues with my Java Servlet if it\'s called with special chars (like Æ, Ø og Å) in the GET-parameters: http://localhost:8080/WebService/MyService?test=Øs
This needs to be configured at servet level. It's not clear which one you're using, so I'll give examples for Tomcat and Glassfish only.
Tomcat: add URIEncoding
attribute to <Connector>
element in /conf/server.xml
:
<Connector ... URIEncoding="UTF-8">
Glassfish: add <parameter-encoding>
to /WEB-INF/glassfish-web.xml
(or sun-web.xml
for older versions):
<parameter-encoding default-charset="UTF-8" />
You could try the following code before requesting parameters:
request.setCharacterEncoding("utf-8");
you should be percent encoding special characters (http://en.wikipedia.org/wiki/Percent-encoding). In your example above, the "slashed O" (Ø) has the UTF-8 code 0xd8, so your URL would properly be written:
http://localhost:8080/WebService/MyService?test=%d8st.
Which should result in
Øst.
being printed to the console, from your servlet code above.