Why is my web page displaying ???? instead of content
I used the Resource Bundle editor to create an _hi (Hindi language locale) file in eclipse.
My problem is that if I run my webpage it will display ???? instead of Hindi content.
I have provided the code below. It works great with French.
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 about the error.
+3
source to share
No one has answered this question yet
Check out similar questions: