2005-3-29 16:38:27 |
作者: 月光 |
分类: 编程开发 |
评论: 1 |
浏览:

本文解决了JSP的URL字符 encoding 问题:
如果通过 get/post 方式从 browser 返回的值中包含汉字信息, servlet 将无法得到正确的值。
解决方案
https://www.williamlong.info/index.jsp?value=你好
解决方案是用这种方案:
<%@ page contentType="text/html;charset=gb2312" %>
<html>
你好<%=new String(request.getParameter("value").getBytes("8859_1"),"gb2312")%>
</html>
