<%
String content2=java.net.URLEncoder(content);
%>
a.jsp?content=<%=content2%>在a页面中:
String content=java.net.URLDecoder(request.getParameter("content"));

解决方案 »

  1.   

    但是不行,代码如下,哪里错了?
    <%@ page import="java.util.*" %>
    <%@ page contentType="text/html;charset=EUC-JP"%>
    <%String s = "いつもお世話になっております";%>
    <script>
    function a(){
    window.location="test.jsp?s=<%=java.net.URLEncoder.encode(s)%>";
    }
    </script>
    <form>
    <input type=button value="test" name=b onclick="a()">
    the Request s is <%=java.net.URLDecoder.decode(request.getParameter("s"))%>.
    <br>
    输出结果是:
    the Request s is 潤譓&#12539;潤譓&#12539;潤譓&#12539;潤譓&#12539;遵&#63728;潤譓&#12539;遵&#65384;潤譓&#12539;潤譓&#12539;潤譓&#12539;潤譓&#12539;潤譓&#12539;潤譓&#12539;潤譓&#12539;潤&#12539;.. 
    </form>