public 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";
}
我在jsp里用这个,不知道对你是否有用。呵呵!
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";
}
我在jsp里用这个,不知道对你是否有用。呵呵!
没有加你那个的是侯就是这样:°?°?°?,
加了你那段代码就变成这样:???,另外我是加在actionform中的,jsp中怎么加啊?
《3、Struts完全中文显示解决方案》
OR
<% request.setCharcterEncoding("gb2312"); %> Action中: reponse.setContentType("text/html; charset=gb2312"); 应该没有问题的!
一起学习JAVA,
一起进步!!!6276733
contentType="text/html; charset=GB2312"