jsp,html页面乱码,但是显示页面能够显示正常的汉子,求解

我是一个新手,刚到公司,公司做这个系统的人都跳槽了,拿到这个项目,要修改,jsp,html页面乱码,但是显示页面却可以正常显示汉子,在网上查了好多资料,没有满意的结果,求大虾看看是啥问题啊

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="styles/sys_admin.css" rel="stylesheet" type="text/css" />

<title>ϵͳ����ƽ̨��¼</title>

<script type="text/javascript">
function check(){
if(document.form1.username.value==""){
alert("�û���Ϊ�գ�");
document.form1.username.focus();
return false;
}
if(document.form1.password.value==""){
alert("����Ϊ�գ�");
document.form1.password.focus();
return false;
}

if(document.form1.validity.value==""){
alert("��֤��Ϊ�գ�");
document.form1.validity.focus();
return false;
}

return true;
}
</script>
</head>

<body onload="document.form1.username.focus();">
<div id="sys_admin">
<div id="interface">
  <form id="form1" name="form1" method="post" action="./login.do" onsubmit="return check();">
                         <input type="hidden" name="userType" value="0"/>
<div class="inter_form">
<ul>
<li><label for="username">�û���</label><input type="text" name="username" /></li>
<li><label for="password">�ܡ��룺</label><input type="password" name="password" /></li>
<li><label for="validate_num">��֤�룺</label><input class="shortinput" type="text" name="validity" /><img src="/images/validity.jpg" /></li>
</ul>
<div class="sys_admin_login">
<input type="image" src="images/login.gif" />
</div>
</div>
</form>
</div>
</div>
</body>
</html>

 

可以参考我的[url]http://www.iteye.com/post/2322208[/url]

简单来做,用记事本打开,复制内容,然后删除乱码的jsp中的内容,粘贴回去

字符集的问题吧

编辑器编码方式引发的血案。。。
以前写这个代码的人保存的编码方式跟你现在打开的编码方式不一样就很可能会这样乱码。。。试着改几个打开时的编码方式看看。。

试着用别的方式打开吧,或者直接改编码方式

把整个workspace编码改下 window -pprference-general-workspace

这个是因为你工具设置的编码格式和这个文件本身的格式不一致导致的,你可以在文件上右键,properties更改编码格式,希望对你能有所帮助

可能是之前用其他的编码敲上去的字,后来换编码导致的,如果量不多的话直接删了在重新写。

明显是他之前编辑该文件使用的编码格式和你现在编辑该文件使用的编码格式不一致,在eclipse下更换编码格式即可。

开发工具的编码格式不对

worksace里面乱码了。在eclipse里面设置下。重新导入项目。