1// 在jsp中 2 String add = java.net.URLEncoder.encode("添加", "utf-8"); 3 add = java.net.URLEncoder.encode(add, "utf-8"); 4//在from标签中5 <form action="Servlet/FinancialServlet?topic=<%=add %>" method="POST" >
在接收方
1 String topic = request.getParameter("topic"); 2 topic = java.net.URLDecoder.decode(topic, "utf-8");
这样接收到的就不是乱码啦
时间: 2024-12-27 08:24:12