jsp页面乱码
下面代码,执行后出现页面乱码的情况,该怎么处理????
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*,java.util.*,value.*,dao.*" errorPage="" %>
<script type="text/javascript">
function callback(msg)
{
document.getElementById("TPWZ").outerHTML = document.getElementById("TPWZ").outerHTML;
document.getElementById("msg").innerHTML = "<font color=red>"+msg+"</font>";
}
function check_image()
{
var image=ImageForm.TPWZ.value;
if(image=="")
{alert("请选择图片");
return false;
}
var sm=ImageForm.TPSM.value;
if(sm=="")
{alert("请填写图片说明")
return false;
}
}
</script>
<div class="fun">
<div class="title">
<div class="exp" onclick="$('#search').toggle();"></div>
台站图片上传</div>
<div id="search">
<form name="ImageForm" method="post" enctype="multipart/form-data" onSubmit="return check_image()" action="./uploadImage" target="hidden_frame">
<table width="754" border="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table width="754" border="0">
<tr>
<td width="126"><div align="right">区站号:</div></td>
<td width="523"><label for="TZH"></label>
<select name="TZH" id="TZH">
<% MetadataInformationSummary_DAO d=new MetadataInformationSummary_DAO();
ArrayList<MetadataInformationSummary> marray=(ArrayList<MetadataInformationSummary>)d.select_ALLMetadata();
Iterator<MetadataInformationSummary> miter = marray.iterator();
while(miter.hasNext())
{
MetadataInformationSummary meta=(MetadataInformationSummary)miter.next();
out.println("<option value="+meta.getMetadataIdentifiers()+">"+meta.getMetadataIdentifiers()+"</option>");
}%>
</select></td>
<td width="12"> </td>
<td width="75"> </td>
</tr>
<tr>
<td width="126"><div align="right">请选择图片位置:</div></td>
<td width="523"><label for="TPWJ"></label>
<input type="file" name="TPWZ" id="TPWZ" /><font size="2" color="#FF0000">只能是*.JPG、*.GIF或*.TIF格式</font></td>
<td width="12"> </td>
<td width="75"> </td>
</tr>
<tr>
<td align="right">图片文字说明:</td>
<td><label for="TPSM"></label>
<textarea name="TPSM" id="TPSM" cols="45" rows="5"></textarea>
<font size="2" color="#FF0000" >*</font></td>
<td> </td>
<td><img src="./image/right.png" /><input type="submit" value="导入" class="btn" /></td>
</tr>
<tr>
<th></th>
<td>
<span id="msg"></span></td></tr>
</table>
<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe>
</form>
</div>
</div>
[解决办法]
右键你的乱码页面,选择“编码”,选择“Unicode(UTF-8)”
[解决办法]
项目右键--》properties --》resource--》other改为UTF-8