Our application uses Spring MVC Framework and also it use sitemesh decorators to decorate the page.I have a problem in displaying the unicode characters in my application along with the decorator.
If i exclude the decorator, am able to display the unicode characters, but it should not be the solution. our application has to support the Japanese and chinese characters.
I have tried all the below items but no luck.
a) Included the page encoding and <meta> tag in both decorator and decoratee page
Expand|Select|Wrap|Line Numbers
- <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
Expand|Select|Wrap|Line Numbers
- <filter>
- <filter-name>encodingFilter</filter-name>
- <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
- <init-param>
- <param-name>encoding</param-name>
- <param-value>UTF-8</param-value>
- </init-param>
- <init-param>
- <param-name>forceEncoding</param-name>
- <param-value>true</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>encodingFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
Expand|Select|Wrap|Line Numbers
- <sitemesh>
- <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
- <excludes file="${decorators-file}"/>
- <page-parsers>
- <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
- </page-parsers>
- <decorator-mappers>
- <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
- <param name="config" value="${decorators-file}"/>
- </mapper>
- </decorator-mappers>
- </sitemesh>
Expand|Select|Wrap|Line Numbers
- request.setCharacterEncoding("UTF-8");
- response.setCharacterEncoding("UTF-8");
- response.setContentType("text/html; charset=UTF-8");