不能支持中文目录?....等待 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">改为:<meta http-equiv="Content-Disposition" content="text/html; charset=gb2312">试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试试这个:String temp="inline; filename=\""+filename+"\"";temp=new String(temp.getBytes("gb2312"),"iso8859-1"); response.setHeader("Content-Disposition",temp); 或者第一:在jsp页面加入:<%@ page contentType="text/html; charset=gb2312" %>或者在servlet里面 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=gb2312");上面的如果在不行就用如下的方法在数据入库前进行调用:public static String UnicodeToChinese(String s){ try{ if(s==null||s.equals("")) return ""; String newstring=null; newstring=new String(s.getBytes("ISO8859_1"),"gb2312"); return newstring; } catch(UnsupportedEncodingException e) { return s; } }public static String ChineseToUnicode(String s){ try{ if(s==null||s.equals("")) return ""; String newstring=null; newstring=new String(s.getBytes("gb2312"),"ISO8859_1"); return newstring; } catch(UnsupportedEncodingException e) { return s; } } Java国际化、多语言的实现方式探讨. ext 关于统计数量问题 请高手们帮解决 正则 itext中pdf反向应用问题,即将pdf页面输出成图片,求助! 软件问题? 导入项目后出现的问题 不知道是哪里错了 求助 我想在,插入或更新之后,弹出一个对话框,显示插入或者更新成功该怎么做呢? 急......跪求解决方法~ 请教各位高人应该如何实现这样一个功能的自定义标签? 后台取不到前台页面parameter值 使用windows.open打开一个输出流后如何设置页面title 不用桥接器怎样连Access数据库? 为什么JSP读取Access数据时,不能完全显示完整的数据?
String temp="inline; filename=\""+filename+"\"";
temp=new String(temp.getBytes("gb2312"),"iso8859-1");
response.setHeader("Content-Disposition",temp);
第一:
在jsp页面加入:
<%@ page contentType="text/html; charset=gb2312" %>
或者在servlet里面
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html; charset=gb2312");
上面的如果在不行就用如下的方法在数据入库前进行调用:
public static String UnicodeToChinese(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}public static String ChineseToUnicode(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}