Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL format tag not showing the special character  RSS feed

 
Manikandan Muthusamy
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!