473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Not able to display the unicode characters using Sitemesh decorators

184 100+
Hi,

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
  1. <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
  2. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
  3.  
b) In web.xml, i have included the below parameters for the character encoding filter
Expand|Select|Wrap|Line Numbers
  1. <filter>
  2.     <filter-name>encodingFilter</filter-name>
  3.     <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  4.     <init-param>
  5.         <param-name>encoding</param-name>
  6.         <param-value>UTF-8</param-value>
  7.     </init-param>
  8.     <init-param>
  9.         <param-name>forceEncoding</param-name>
  10.         <param-value>true</param-value>
  11.     </init-param>
  12.  </filter>
  13.  
  14.  
  15.  <filter-mapping>
  16.     <filter-name>encodingFilter</filter-name>
  17.     <url-pattern>/*</url-pattern>
  18.  </filter-mapping>
  19.  
c) In sitemesh.xml, i have the below entry
Expand|Select|Wrap|Line Numbers
  1. <sitemesh>
  2.     <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
  3.     <excludes file="${decorators-file}"/> 
  4.     <page-parsers>                
  5.         <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>               
  6.     </page-parsers>
  7.  
  8.     <decorator-mappers>
  9.         <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
  10.             <param name="config" value="${decorators-file}"/> 
  11.         </mapper>
  12.     </decorator-mappers>
  13. </sitemesh>
  14.  
d) In controller, i have set the character encoding in both request and response.
Expand|Select|Wrap|Line Numbers
  1.     request.setCharacterEncoding("UTF-8");
  2.     response.setCharacterEncoding("UTF-8");
  3.     response.setContentType("text/html; charset=UTF-8");
  4.  
Thanks in Advance.
Sep 2 '11 #1
1 2536
drhowarddrfine
7,435 Expert 4TB
This is a Java question, not HTML. However, if you can supply the generated markup or, preferably, a link, we might be able to help.
Sep 3 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Daman | last post by:
Hi, I am currently facing difficulty displaying chinese, japanese, russian etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2 unicode database (UTF-8). The resultset that...
5
by: Borko | last post by:
hi I am having problems getting unicode characters into VB. Using VB6 (sp3) and Access 2000 Characters are displayed correctly in Access, just when I use ADODB (2.7) to read them in VB i get ?...
7
by: c.verma | last post by:
I have a web application. There is a page which has a datagrid on it.The datagrid displays the data that comes from SAP. SAP sends the chinese characters to this grid. Before I display CHinese...
3
by: Christian Nunciato | last post by:
Hi all: I've read through the various related posts in this forum, but without any success as yet. I've got an ASP.NET application built in VS.NET 2003, and I'm trying to get the Armenian...
3
by: Jennifer | last post by:
Hi, Is there anyone to have idea how to make the MFC CDialog box display Unicode (like Chinese characters) in .NET 2005? We have some dilog boxes created from CDialog class in VC++ 6.0 and try...
6
by: Bill Nguyen | last post by:
I'm getting data from a mySQL database (default char set = UTF-8). I need to display data in Unicode but got only mongolian characters like this: Phạm Thị Ngọc I changed the textbox font to...
1
by: asiru | last post by:
My mission is to print Unicode characters using this program.I have been on this for several months. I follow the following procedure to enable unicode; 1.File > New> Project>win 32 console...
6
by: Shankar | last post by:
Hi, I am not able to print the Unicode character on the console. I tried with these API's 1) wprintf() displays ??????? 2) _cwprintf() displays
6
by: geegeegeegee | last post by:
Hi All, I have come across a difficult problem to do with extracting UniCode characters from RTF strings. A detailed description of my problem is below, if anyone could help, it would be much...
0
by: Dilip | last post by:
I ran into a situation at work regarding unicode character encodings and .NET cultures that left me a tad bit confused. I was trying to instantiate a CultureInfo object from a locale identifying...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.