用  base64编码. 发送参数时候先用base64编码,到服务端再解码

解决方案 »

  1.   

    JSP中是这么写的
    <%@ page contentType="text/html;charset=gb2312" language="java" %>
    <jsp:useBean id="DIRY02Form" scope="request" class="diary.DIRY02Form"/>
    <html>
    <head>
    <title>心情日记登录画面</title>
    <script language="JavaScript">
    <!--
    //登录Button用
    function onSubmit(){
    document.forms[0].flag.value=4;
    document.forms[0].action = "/wj/showdiary00.do";
    document.forms[0].target = "_self";
    document.forms[0].submit();
    }
    -->
    </script>
    </head><body background="./images/bg_border.gif" ><form name="form" method="post">
    <table width="100%" >
    <tr>
    <td>心情日记登录</td>
    </tr>
    </table>
    <table width="600">
    <tr>
    <td>题目:<input type="text" name="title" value="<%=DIRY02Form.getTitle()%>"></td>
    </tr>
    </table>
    <div align="center">
    <button class="button" type="button" name="btnRegist" onClick="javascript:onSubmit();"><img src="./images/button/regist.gif">登录确认</button>
    </div>
    <input type="hidden" name="flag" value="<%=DIRY02Form.getFlag()%>">
    </form>
    </body>
    </html>Java中这样转的码String Title = new String(form.getTitle().getBytes("GBK"),"ISO8859_1");但是转完后还是乱码,请问是怎么回事?