When I run JSP page with RequsetDispatcher it shows me the cyrillic content with "????...".
RequestDispatcher view = request.getRequestDispatcher("/view.jsp");
Here is what I tried:
I am using Apache Tomcat and I added that in the VM-options:
-Dfile.encoding=UTF-8
In the beginning of the jsp file:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
In web.xml:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>utf-8</page-encoding>
</jsp-property-group>
</jsp-config>
<filter>
<filter-name>CharSet</filter-name>
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharSet</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
In the connectors in tomcat configuration file conf/server.xml:
URIEncoding="UTF-8"
And it still doesn't work. Any ideas how to fix it?
Edit: Fixed when I aded response.setCharacterEncoding("UTF-8");
in the Servlet method.