出现乱码!是否是配置不行 <meta http-equiv="Content-Type" content="text/html; charset=big5">改成<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <meta http-equiv="Content-Type" content="text/html; charset=big5">去掉好了 但页面传还是会出现乱码。如下程序接收传来数据<%@page contentType="text/html;charset=gb2312"%><%@ page language="java" import="java.util.*;" %><%! Hashtable userTable = new Hashtable(); public int getCount( String userName ){ Integer count = (Integer)userTable.get( userName ); if( count != null ){ int nowCount = count.intValue() + 1; userTable.put( userName, new Integer( nowCount ) ); return nowCount; } userTable.put( userName, new Integer( 1 ) ); return 1; } %><% String username = request.getParameter( "textUserName" ); int count = getCount( username );%><html><head><title>Login Counter</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body bgcolor="#FFFFFF"><div align="center">哈罗!<font color="#3333FF"><b><%= username %></b></font>您已经到本站来参观<font color="#3333FF"><b><%= count %></b></font>次</div></body></html> text/html; charset=gb2312的空格去掉,一般多页面传送时,只要charset的值统一就不会出现乱码了.tomcat对中文支持不好要不行换成content="text/html;charset=iso_8859_1"试试 【求教】java web开发中去除session对象 新手求教 如何获取“多级代理”后客户端的ip 求解Io 异常: Socket closed 请教大家frameset中frame用response.sendRedirect("父页")如何实现 分享一下以前坛里收集的工具类(方法),希望大家一起来共享下,方便以后使用 菜鸟问题:怎样在一个html或者jisp页面下调用一个应用程序呀 tomcat 是否正常? 关于怎样删除重复记录的问题。 jsp页面可以使用内置对象,那岂不是很危险 请教一个关于tomcat+apache问题? 电脑故障求解!
<%@ page language="java" import="java.util.*;" %>
<%!
Hashtable userTable = new Hashtable();
public int getCount( String userName ){
Integer count = (Integer)userTable.get( userName );
if( count != null ){
int nowCount = count.intValue() + 1;
userTable.put( userName, new Integer( nowCount ) );
return nowCount;
}
userTable.put( userName, new Integer( 1 ) );
return 1;
}
%>
<%
String username = request.getParameter( "textUserName" );
int count = getCount( username );
%>
<html>
<head>
<title>Login Counter</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">哈罗!
<font color="#3333FF"><b><%= username %></b></font>
您已经到本站来参观
<font color="#3333FF"><b><%= count %></b></font>次</div>
</body>
</html>
content="text/html;charset=iso_8859_1"试试