还是中文问题:url(../test.jsp?a=救救我),其中,test.jsp接受request参数并打印,weblogic6.0上运行,却总是乱码!

Mars_lee 2001-08-21 05:11:24
test.jsp内容如下:
out.println(new String(request.getParameter("a").getBytes("UTF-8")));

...全文
208 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Anreddy 2002-03-06
  • 打赏
  • 举报
回复
.....
skyyoung 2001-08-22
  • 打赏
  • 举报
回复
为什么不用
java.net
Class URLEncoder
java.lang.Object
|
+--java.net.URLEncoder

static String encode(String s)
Translates a string into x-www-form-urlencoded format.
Mars_lee 2001-08-22
  • 打赏
  • 举报
回复
thanks!!!!!!
Mars_lee 2001-08-22
  • 打赏
  • 举报
回复
help..................
Mars_lee 2001-08-21
  • 打赏
  • 举报
回复
多谢,可还是不成....
hexiaofeng 2001-08-21
  • 打赏
  • 举报
回复
String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
}
return "null";
}

试一试<%@page language="java" contentType="text/html;charset=gb2312">
or
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
Mars_lee 2001-08-21
  • 打赏
  • 举报
回复
不成:(
hexiaofeng 2001-08-21
  • 打赏
  • 举报
回复
String sss ="你";
String line = new String(sss.getBytes("ISO-8859-1"),"GBK");
or
String line = new String(sss.getBytes("gb2312"));

81,092

社区成员

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

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