一个乱码的问题
我用<%@ include file="header.jsp"%>就不会出现乱码,而用<jsp:include page="header.jsp"></jsp:include> 就要出现乱码,这是为什么呢?
我在页面开始都加了<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
问题点数:20、回复次数:8Top
1 楼lcwlyl(网络幽灵)回复于 2005-11-02 08:44:59 得分 1
后一种的编码方式不符。。Top
2 楼usherlight(xingtian)回复于 2005-11-02 09:10:41 得分 4
加上这一句 <%@ page contentType="text/html;charset=GB2312"%>Top
3 楼007JavaKing(乖乖咙的咚)回复于 2005-11-02 09:21:49 得分 1
后一句需要编译,中文字符到JVM里传递有可能会产生乱码。Top
4 楼yunqing1028(-_-)回复于 2005-11-02 09:44:44 得分 0
upTop
5 楼wulemale(wulemale)回复于 2005-11-02 09:49:30 得分 1
把; charset=gb2312删掉Top
6 楼zeq258(周二强)回复于 2005-11-02 10:26:54 得分 4
回复人: 007JavaKing(猛将兄) ( ) 信誉:95 2005-11-02 09:21:00 得分: 0
后一句需要编译,中文字符到JVM里传递有可能会产生乱码。
-----------------------------------
顶Top
7 楼guishuanglin(蓝色枫林)回复于 2006-01-02 16:07:33 得分 5
jsp页面保存到数据库有乱码解决方法
Jsp+tomcat+bean中文乱码问题解决方法javabean中参数有乱码
1) 所有的jsp页面指定字符编码方式,如:Charest=gb2312,Charest=UTF-8等等
2) 在应用服务器中的server.xml方件中找到设置服务器端口的行,一般是这样开头:”<Connector port="8080"”,
3) 在找到的行"<Connector"开头的字符串后加上:URIEncoding="UTF-8" ,保存文件
--------------------------------------------------------------------------
jsp页面有乱码解决方法
所有的jsp页面指定字符编码方式,如:Charest=gb2312,Charest=UTF-8等等
<%@ page contentType="text/html; charset=UTF-8">
--------------------------------------------------------------------------
jsp单个中文参数乱码解决方法
用这个转换一下:
<%!String trans(String chi)
{
string result =null;
byte temp[];
temp=chi.getBytes("iso=8859-1");
result= new String(temp);
}
%>
或者直接这样:
<%
request.setCharacterEncoding("UTF-8");
out.println(request.getParameter("参数ID")
%>
--------------------------------------------------------------------------
Top
8 楼tianzhi21(花无第二阶段)回复于 2006-01-02 16:13:23 得分 4
这个最简单
try
{
this.text1=new String(text1.getBytes("ISO-8859-1"),"GBK");
}
catch(Exception e1)
{
}Top




