Hi I am trying to create an application with hindi fonts (Only Lable required to be shown in hindi)with the help of Struts2 i18n feature.
I have cretaed required properties file as global_hi.properties
for the label username ,password and submit button.
It works fine for submit button,but for password its showing *??? .
I have attached my jsp ,struts.xml and proerties fiel.
struts.xml is
<struts>
<constant name="struts.custom.i18n.resources" value="global" />
<constant name="struts.devMode" value="true" />
<package name="default" extends="struts-default, tiles-default,jfreechart-default">
<interceptors>
<interceptor name="loginInterceptor" class="common.AuthenticationInterceptor" />
<interceptor-stack name="chkSession">
<interceptor-ref name="i18n"/>
<interceptor-ref name="defaultStack" />
<interceptor-ref name="loginInterceptor" />
</interceptor-stack>
</interceptors>
<global-results>
<result name="invalid.token">common/doublePost.jsp</result>
<result name="loginAction" type="redirect">/sessionnotfound.jsp</result>
</global-results>
<action name="showHomePage">
<result type="tiles">Login</result>
</action>
<action name="locale">
<result type="tiles">Login</result>
</action>
</package>
</struts>
my jsp is
<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Administration Login</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link href="/LiquorShopManagementSystem/css/stylesheet.css" type="text/css" rel="stylesheet">
<s:head/>
</head>
<body>
<div id="header"></div>
<s:form name="frmAdminLogin" id="frmAdminLogin" method="post" action="doLogin" validate="true">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="border-right:fuchsia 2px solid;">
<img src="/LiquorShopManagementSystem/images/BookShop.jpg" height="250"/>
</td>
<td valign="middle">
<table align="center" cellspacing="0" cellpadding="4" border="0" width="248px">
<tr>
<td colspan="2" class="spanHeader">
<span>Back Officeghj</span>
</td>
</tr>
<tr>
<td colspan="2" align="left" class="error">
<s:property value="message" />
</td>
</tr>
<tr>
<td valign="middle">
<s:textfield required="true" requiredposition="left" maxLength="25" key="global.username" name="userMaster.loginid" title="Enter Username"/>
<s:password required="true" requiredposition="left" maxLength="8" key="global.password" name="userMaster.Password" title="Enter Password"/>
</td>
</tr>
<tr>
<td>
<s:submit cssClass="buttonText" cssStyle="background:url(/BookShop/images/submit_bg.gif) no-repeat scroll 37px 0px;" name="login" key="global.submit" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</s:form>
</body>
</html>
and properties file is
#Global messages
global.username = Username
global.password =\u0938\u092E\u094D\u092E\u0947\u0932\u0928
global.submit =\u0938\u092E\u094D\u092E\u0947\u0932\u0928
although it is working fine for submit tag.
Can any one suggest for any workaround for this.
thanks
This is what i tried and its working fine for me.All i changed the value in my property file
and here is the output screenshot
i believe you need to check the way you are encoding your Hindi characters.
surprising, it giving following output when i am using your entries..