I currently use
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
in my jsp page.
And when I get data from textbox using request.getParameter("...");
it retrieves data like that öÉ?É?É?öİ
. I saw this problem when I used characters that are not english chars. I add URIEncoding="UTF-8"
to server.xml
in tomcat. But it retrieved the same (öÉ?É?É?öİ)
. How to solve it?
Thank you
EDIT
Thanks for your answers. I tried a few things, but nothing has fixed the problem.
Here's what I've done:
I added
<Connector URIEncoding="UTF-8" .../>
in server.xml.<meta ... charset=utf-8>
tag is ok and I triedrequest.setCharacterEncoding("UTF-8");
- I also tried
<filter>
tag in web.xml
None of these actions fixes the problem. I'm wondering if there's something else wrong with this...(remembering: I used <form method='post'>
. I click submit button and when I get data using request.getParameter("..")
the format of this data is not the correct format. )
UTF 8 should be set at all the layers of the application.
Do following
1) HTML Code
2) Browser Setting for IE View -- Encoding -- Unicode (UTF-8)
3) Tomcat Server server.xml - In Connector tag added "URIEncoding" attribute as
catalina.sh/catalina.bat - added following
4) MIME type of response should be "application/x-www-form-urlencoded"