Why my webpage displays ???? instead of contents

Viewed 53

I have used Resource Bundle editor to create _hi(Hindi language) locale properties file in eclipse.

My problem is that if I run my webpage, it displays ???? instead of Hindi content.

I have provided code below. It works fine with french language

spring-servlet.xml

  <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
   <property name="paramName" value="siteLang"></property>
  </bean>
 
<bean id="messageSource"
   class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
  <property name="basename" value="WEB-INF/messages"></property>
 </bean>
 
<bean id="localeResolver"
  class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
  <property name="defaultLocale" value="ta"></property>
  <property name="cookieName" value="BalsCookie"></property>
  <property name="cookieMaxAge" value="300"></property>
 </bean>

form.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" href="<spring:theme code='color'/>" type="text/css" />
</head>

<body>
 <a href="http://localhost:8084/SpringMVCP4/form.html?siteLang=hi">Hindi</a>
 <a href="http://localhost:8084/SpringMVCP4/form.html?siteLang=en">english</a>
 <center>
  <h1>${heading}</h1>
 </center>
 <h1>head</h1>
 <form action="/SpringMVCP4/submit" method="post">
  <center>
   <table>
    <tr>
     <td><spring:message code="label.name"></spring:message></td>
     <td><input type="text" name="name"></input><span> <form:errors
        path="student.name"></form:errors></span></td>
    </tr>
    <tr>
     <td class="spring"><spring:message code="label.dob" /></td>
     <td><input type="text" name="dob"></input></td>
    </tr>
    <tr>
     <td><spring:message code="label.skillSet" /></td>
     <td><select name="skillSet" multiple>
       <option>java</option>
       <option>php</option>
       <option>.net</option>
     </select></td>
    </tr>
    <tr>
     <td><spring:message code="label.mobileNo" /></td>
     <td><input type="text" name="mobileNo"></input></td>
    </tr>
    <tr>
     <td><spring:message code="label.street" /></td>
     <td><input type="text" name="address.street"></input></td>
    </tr>
    <tr>
     <td><spring:message code="label.city" /></td>
     <td><input type="text" name="address.city"></input></td>
    </tr>
    <tr>
     <td><spring:message code="label.pincode" /></td>
     <td><input type="text" name="address.pincode"></input><span
      style="color: red"> <form:errors
        path="student.address.pincode" /></span></td>
    </tr>
    <tr>
     <td><spring:message code="label.submit" var="submit" /></td>
     <td><input type="submit" value="${submit}"></input></td>
    </tr>
   </table>
  </center>
 </form>
</body>
</html>

Please let me know the error.

0 Answers
Related