SolveItproblems

SolveITProblems is a project of QFormat.net intellectual club

SolveITProblems это проект интеллектуального клуба QFormat.net

четверг, 15 апреля 2010 г.

JSP Unicode Problem

Imagine you write a jsp-servlet web-application which works perfectly at your NetBeans but when you deploy it at the real server it doesnt work. :(
Problem:
when i send parameters through GET method which contains Unicode characters they are transformed (because of wrong encodding of course). i use

request.setCharacterEncoding ("UTF-8") but it doesnt affect.

As i understand it s problem of the Apache Tomcat web-server, i use Glassfish but have the same result. So, i begin to configure the Apache Tomcat 6.0.20 , and found interesting things

at conf directory we have a server.xml file where we have tag Connector , we have to add some parameter here. So, if i use request.setCharacterEncoding ("UTF-8") it will be enough to add this line useBodyEncodingForURI="true" , or you can add this line
URIEncoding="UTF-8".
thats enough!
restart the Apache and its working :) ...

Комментариев нет:

Отправить комментарий