Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

JSTL format tag not showing the special character  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am using the JSTL to read/show the properties values on the screen (using fmt - tag). Now my problem is the properties contains English values then – reading fine. In case I try to load the Japanese values then not loading properly – I checked – JSTL default charset is ISO-5589-1. So, char not showing properly.

In my JSP page I setting request encoding type (response and format tag)

1. response.setCharacterEncoding("UTF-8");
2. <fmt:requestEncoding value="utf-8"/>

Always getting the wrong Japanese char.

I here attached the properties files.

JSP
****

<%@ page isELIgnored ="false" %>
   <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
   <%@ taglib prefix="fmtMdfOrder" uri="http://java.sun.com/jsp/jstl/fmt" %>
   
<fmtMdfOrder:setLocale value="ja_JP"/>
<fmtMdfOrder:setBundle basename="com.pro.GmOrderAction"/>
<fmtMdfOrder:requestEncoding value="UTF-8"/>
<%
response.setCharacterEncoding("UTF-8");
System.out.println(" Hello world testing ");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><fmtMdfOrder:message key="LBL_MODIFY_ORDER"/></title>
</head>
<body>
<fmtMdfOrder:message key="LBL_MODIFY_ORDER"/>
<fmtMdfOrder:message key="LBL_HEADER"/>
<fmtMdfOrder:message key="LBL_CUSTPO"/>
<fmtMdfOrder:message key="LBL_PARDO"/>
<fmtMdfOrder:message key="LBL_ORDDATE"/>
出荷日

</body>
</html>

Properties
*************
LBL_MODIFY_ORDER = 注文を修正する
LBL_HEADER  = 受注 - 編集
LBL_REP_ACCT  = Repアカウント
LBL_ORDERID  = 注文ID
LBL_PARENT_ACCOUNT  = 親アカウントを表示する


Please let me know what can I do for this.


Thanks,
Mani
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!