不知道为什么,我将在里面编辑完的文本显示时就是乱码呢?我是按照指导书一步一步完成的,指导书的源码运行时是可以显示正确的文本的。显示页面是这样写的:
<%@ page language="java" pageEncoding="utf-8"%>
<html>
<head>
<title>fckeditor编辑的结果显示</title>
</head> <body>
<hr />
<%
request.setCharacterEncoding("utf-8");
String content = request.getParameter("editorContent");
out.println(new String(content.getBytes("iso-8859-1"),"utf-8"));
%>
<hr />
</body>
</html>
<%@ page language="java" pageEncoding="utf-8"%>
<html>
<head>
<title>fckeditor编辑的结果显示</title>
</head> <body>
<hr />
<%
request.setCharacterEncoding("utf-8");
String content = request.getParameter("editorContent");
out.println(new String(content.getBytes("iso-8859-1"),"utf-8"));
%>
<hr />
</body>
</html>
解决方案 »
- subversion问题 IE浏览器通过配置的用户名和密码能访问 TortoiseSVN客户端却不能访问
- 大家来看看s:iterator 的问题
- 参数转码
- jbpm 中 ExecutionContext 怎么控制跳过一个环节,继续往下执行
- hibernate Criteria nullException 问题!(在线加分)
- 下载时出现的问题 getOutputStream() has already been called for this response
- 真的感觉SPRING不是特别的好,欢迎大家来讨论
- 关于基于struts2 在jsp/action class间传值问题
- 高分!高手请!关于网络搜索的一个问题!
- 关于一个类只能生成它的唯一实例的问题..(急,在线等待,解决了立刻给分~~)
- 用jasreport做过报表的进来看看
- 关于搜索引擎 索引文件的问题
contentType="text/html; charset=GBK"%>
试试这个!
</head>
<%
Enumeration<String> params = (Enumeration<String>) request.getParameterNames();
%>
<body>
<h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form.
<hr />
<table width="100%" border="1" cellspacing="0">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999">
<td nowrap="nowrap">Field Name </td>
<td>Value</td>
</tr>
<%
String parameter;
while(params.hasMoreElements()) {
parameter = params.nextElement();
%>
<tr>
<td nowrap="nowrap"><b><%=parameter%></b></td>
<td width="100%"><%=request.getParameter(parameter)%></td>
</tr>
<%
}
%>
</table>
</body>