How to handle special chars in parameter values?

前端 未结 3 730
闹比i
闹比i 2020-12-22 04:00

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

3条回答
  •  情深已故
    2020-12-22 04:31

    You could try the following code before requesting parameters:

    request.setCharacterEncoding("utf-8");
    

提交回复
热议问题