有两个页面:
页面1.jsp内容如下:
<%@ page contentType="text/html; charset=gb2312"%>
<script language="javascript">
with (document) 
{
write("<table id='popTable' border='0' bgcolor='#99ccff'></TABLE>");
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body>
<form name="form1" method="post" action="2.jsp">
    <input name="ZICHAN_NAME" type="text" value="空调机" size="20" maxlength="20">
    <input name="AA" type="text" value="&nbsp;" size="20" maxlength="20">
    <input name="Submit" type="submit" class="style4" value=" 保 存 数 据 ">
</form>
</body>
</html>页面2.jsp的内容如下:
<%@ page contentType="text/html; charset=GB2312"%><%
String name = request.getParameter("ZICHAN_NAME");
System.out.println("得到的汉字是"+name);
out.print(name);
%>运行结果:
先运行1.jsp, 点击“保存数据”按钮后进入页面2,程序运行完毕,页面上显示“空调机”三个汉字,但查看websphere 的systemout.log文件发现,输出的内容如下所示:
[06-2-21 20:23:44:594 CST] 5116c57c SystemOut     O 得到的汉字是&#31354;&#35843;&#26426;修改页面1.jsp,把
write("<table id='popTable' border='0' bgcolor='#99ccff'></TABLE>");
注释掉,即改为:
//write("<table id='popTable' border='0' bgcolor='#99ccff'></TABLE>");
再次运行,页面上仍然正常显示“空调机”三个汉字,但查看websphere 的systemout.log文件发现,输出的内容如下所示:
[06-2-21 20:23:44:594 CST] 5116c57c SystemOut     O 得到的汉字是空调机
显示正常;还有一种修改方法:
不注释那条语句,只需要把1.jsp中的
<input name="AA" type="text" value="&nbsp;" size="20" maxlength="20">
中的&nbsp;去掉,即改为
<input name="AA" type="text" value="" size="20" maxlength="20">
,运行结果:页面上显示“空调机”,查看websphere 的systemout.log文件发现,输出的内容也是正常的:
[06-2-21 20:23:44:594 CST] 5116c57c SystemOut     O 得到的汉字是空调机
websphere版本:5.1
jdk: 1.4.
对websphere未做过任何配置请问大侠:这是为什么?
这个问题已经困惑我好久了?