有关于get和post在Tomcat中!

虎叔 2001-08-30 04:11:04
如果我POST一个中文值的文本框,服务端可以正确显示可是我用GET,例如:
http://localhost:8080/index.jsp?id=我的
中文显示为:??
请问如何解决?
...全文
83 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
用什么服务器?
chenyun2000 2001-08-31
  • 打赏
  • 举报
回复
out.println(new String(request.getParameter("id").getBytes("ISO8859-1"), "GBK"));
lci21 2001-08-30
  • 打赏
  • 举报
回复
利用下面的方法进行处理一下。

public String Strdeal(String str1)
{
String str=null;
try
{
byte[] str2=str1.getBytes("ISO8859-1");
str = new String(str2);
}
catch(Exception e){System.out.println(e);}
return str;
}

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧