传递页面:
<form name="myform" action="eWebEditor/submit.jsp" method="post">
<table class="data_list_table">
<tr>
<th>生产计划</th>
</tr>
<% 
if(role.equals("管理员")) 
{
%>
<tr>
<INPUT type="hidden" name="content1" value="<p>&nbsp;</p><p><font color=#ff0000>本样式为自带默认样式,最佳调用宽度650px,高度350px!</font></p><p>下面为一些高级调用功能的例子,你可以用脚本方便的编辑进行一些操作。</p><p>看到这些内容,且没有错误提示,说明安装已经正确完成!</p><p>您现在使用的是飞鱼修改版,有什么问题请到http://www.fiyu.net提出!</p>">
<td height="213" class="list_data_text"><IFRAME  ID="eWebEditor1" src="eWebEditor/eWebEditor.jsp?id=content1&style=standard" frameborder="0" scrolling="no" width="650" height="350"></IFRAME></td>
</tr>
<TR>
<TD colspan=2 align=right>
<INPUT type=submit name=b1 value="提交">
<INPUT type=reset name=b2 value="重填">
<INPUT type=button name=b3 value="查看源文件" onclick="location.replace('view-source:'+location)">
</TD>
</TR>
<% }else
{
%>
    <tr>
<td height="213" class="list_data_text"><textarea name="plantest" cols="110" rows="30" readonly="true"><%=plan %></textarea></td>
</tr>

<% }
%>

</table>
</form>

解决方案 »

  1.   

    接受页面<%@ page language="java" import="java.util.*" pageEncoding="gbk"%><%@ page import="java.io.FileInputStream"%>
    <%@ page import="java.io.FileOutputStream"%>
    <%@ page import="java.nio.ByteBuffer"%>
    <%@ page import="java.nio.channels.FileChannel"%>
    <%@ page import="java.nio.charset.Charset"%>
    <%

    String sContent = new String(request.getParameter("content1").getBytes("GBK"),"GBK");
    System.out.println();
    System.out.println();
    System.out.println();
    System.out.println();
    System.out.println();
    System.out.print("取得的html标记:"+"\n"+sContent+"\n"+"主要问题可能出现在upload.jsp里的第202行的setHtml()");
            out.println("编辑的内容如下:<br><br>"+sContent);
            out.println(
            "<br><br><p><input type=button value=' 退回 ' onclick='history.back()'></p>");
            
            //System.out.println(sContent);
    //得到项目的相对路径

    String path=request.getContextPath();

    //得到计划存放的路径
    String planpath=path+"/plantxt";
    FileChannel fc=new FileOutputStream(request.getRealPath("aa.doc")).getChannel();
    System.out.println(fc);
    //getBytes()使用平台默认的字符集将此 String 解码为字节序列,并将结果存储到一个新的字节数组中。
    //System.out.println(pf.getContent1().getBytes());
    fc.write(ByteBuffer.wrap(sContent.getBytes()));
    fc.close();
    %>
      

  2.   

    你把要传的字符串现在本页面alert出来看看是不是乱码,然后统一两个页面的编码再试试。