wood burning stoves 2.0*
The moose likes JSP and the fly likes Problem with encoding type in the browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with encoding type in the browser" Watch "Problem with encoding type in the browser" New topic
Author

Problem with encoding type in the browser

Lucky Here
Greenhorn

Joined: Dec 25, 2010
Posts: 7
HI ALL

I am using Internationalization in my application using jstl tags. I have the deployed the WAR files in two servers. But in one of the server I am getting invalid characters from the japanese lanaguage , when i check the encoding type in browser , it is showing Western European(ISO). But the other server is working fine for Japanese language also, for this the browser encoding type is Unicode (UTF-8) .


How to resolve this ??? PROVIDING THE jsp and property file

JSP CODE :

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="/cornerstone/js/dojo/dijit/themes/claro/claro.css"/>
<style>

h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: normal;
color: #019BDB;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
label {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
#instructions {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
.error {
color: red;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
text-align: center;
}
#help {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}
#login {
width: 311px;
margin-top: 50px;
margin-bottom: 50px;
}

#contact {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}
th {
font-weight: bold;
}
</style>
<script type="text/javascript" src="/cornerstone/js/dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dijit.Dialog");
</script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>

</head>
<body>
<fmt:setBundle basename="com.zimmer.cornerstone.resources.default"/>
<table width="100%">
<tr>
<td align="left"><img src="/cornerstone/img/mycareer.jpg"/></td>
<td align="right"><img src="/cornerstone/img/zlogo.jpg"/></td>
</tr>
</table>

<form method="POST" action="j_security_check">
<table id="login" align="center" width = 90%>
<tr>
<td colspan="2" id="instructions" align ="left">
<fmt:message key="language"/>
</td>
</tr>
<tr>
<td colspan="2"><img src="/cornerstone/img/line.gif"/></td>
</tr>
<c:if test="${param.error != null}">
<tr>
<td colspan="2" class="error">
<fmt:message key="login_failed"/>
</td>
</tr>
</c:if>
<c:if test="${param.reason != null}">
<tr>

<td colspan="2" class="error"><cut value="${param.reason}"/></td>
</tr>
</c:if>
<tr>
<td width = 50% align ="left"><label for="username"><fmt:message key="username"/></label></td>
<td width = 30 % align="right"><input id="username" type="text" name="j_username" size="25"></td>
</tr>
<tr>
<td width = 50% align = "left"><label for="password"><fmt:message key="password"/></label></td>
<td width = 50 % align="left"><input id="password" type="password" name="j_password" size="25"></td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="<fmt:message key="login"/>"></td>
</tr>

<tr></tr>
<tr></tr>
<tr></tr>

<tr>
<td colspan="2" align = "left" id="help"><fmt:message key="reset_password"/></td>
</tr>
<tr>
<td colspan="2" align = "left" id="contact"><fmt:message key="contact"/></td>
</tr>
</table>
</form>
<div class="claro" id="helpDialog" dojoType="dijit.Dialog" title="Zimmer Help Desk">
</div>

</body>
</html>

Russian property files :

language= Пожалуйста, введите Ваш Логин информацию ниже. И ваше имя пользователя и пароль чувствительны к регистру
login_failed= Неверное имя пользователя или пароль
username= Имя пользователя
password= Пароль
login= Войти
reset_password= Чтобы сбросить ваш пароль, пожалуйста,


 
GeeCON Prague 2014
 
subject: Problem with encoding type in the browser