Dennis83
Jan 4th, 2008, 05:06 AM
Hi all!
I have an Issue that I need to display russian characters and searched for it in the internet, how to solve it with spring.
What I did until now is:
1.
Adding the parameters:
URIEncoding="UTF-8" useBodyEncodingForURI="true"
to my Server.xml of my tomcat 5.
2.
adding a filter to my web.xml
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFi lter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
3.
Adding the contentType property in my application-servlet.xml
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="contentType">
<value>text/html;charset=UTF-8</value>
</property>
</bean>
4 Also adding the following lines in my Jsp:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
If I now for example write the russian word: "Наименование" in my Jsp, It will display in the Browser: Наименование
Does anybody know what I forgot to configure?
Thanks a lot!
Best regards,
Dennis
I have an Issue that I need to display russian characters and searched for it in the internet, how to solve it with spring.
What I did until now is:
1.
Adding the parameters:
URIEncoding="UTF-8" useBodyEncodingForURI="true"
to my Server.xml of my tomcat 5.
2.
adding a filter to my web.xml
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFi lter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
3.
Adding the contentType property in my application-servlet.xml
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="contentType">
<value>text/html;charset=UTF-8</value>
</property>
</bean>
4 Also adding the following lines in my Jsp:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
If I now for example write the russian word: "Наименование" in my Jsp, It will display in the Browser: Наименование
Does anybody know what I forgot to configure?
Thanks a lot!
Best regards,
Dennis