萌萌可爱的冬己动漫:nclude 导入页面时 出现乱码 救命!

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/03 12:24:09
index.jsp
<%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" %>
<%@ page autoFlush="true"%>
<html>

<%@ include file="top.jsp"%>

<table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="10"></td>
</tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" height="148">
<!--DWLayoutTable-->
<tr valign="top">
<td width="180"> <table width="180" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top">
<%@ include file="dengluyufou.jsp"%>

top.jsp

<head>
<link href="css.css" rel="stylesheet" type="text/css">
<%!
boolean IsMail(String user_mail){
int index=user_mail.indexOf("@");
int index2=user_mail.indexOf(".");
if(index==-1 || index2==-1)
return false;
else return true;
}

public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%!
int Cint(String cint)
{
try {
int n;
n= Integer.parseInt(cint);
return n;
}
catch (NumberFormatException e) {
return 0;
}
}
%>
<jsp:useBean id="mdb" class="ckstudio.db.mysqlconn" scope="page"/>
<script>
function openbag(id) { window.open("basket.jsp?hw_id="+id,"","height=420,width=460,left=190,top=10,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}
</script>
<script language="javascript">
function openScript(url, width, height){
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
</script>

在导入TOP 页面时。 全是乱码。该怎么解决?

我试了很多办法,比如在TOP设置页面的字符为GB2312这样设一开始能用。不过有很多菜单就会报错。

在这先谢谢各位了

俺也遇到过
哈 是这样解决的散
加一句这个在最上面HTML开始的地方
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">

因为是没指定CHARSET所以 汉字出现全部乱码现象
在这里分享一下经验

给个旗行不 谢谢楼主了