不是jrun的关系吧
我用的就是jrun啊可能你取数据后需要转码

解决方案 »

  1.   


    解决办法:  
    第一:  
     1:在jsp页面加入:  
    <%@  page  contentType="text/html;  charset=gb2312"  %>  
     2:在servlet里面:  
       public  void  doGet(HttpServletRequest  request,  HttpServletResponse  response)  throws  ServletException,  IOException  {  
           response.setContentType("text/html;  charset=gb2312");//这是重要的  
     
    3:上面的如果在不行就用如下的方法在数据入库前进行调用:  
    public  static  String  UnicodeToChinese(String  s){  
       try{  
             if(s==null  &brvbar;  &brvbar;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  &brvbar;  &brvbar;s.equals(""))  return  "";  
       String  newstring=null;  
       newstring=new  String(s.getBytes("gb2312"),"ISO8859_1");  
         return  newstring;  
       }  
       catch(UnsupportedEncodingException  e)  
       {  
       return  s;  
     }  
       }
      

  2.   

    你说的情况应该是:
    JAVA是支持多种编码方式的,如果没有指明传送的字符是何种编码,JSP会按默认的ISO8859-1方式,由其是表单提交以及从数据库中存取的时候特别常见。你需要根据情况重新转换一下,可以用  String(str.getBytes(),"GB2312"),  
    也可以用下面的代码段。  
    int  n  =  srouceString.length();  
    byte  temp[]  =  new  byte(n);  
    for(int  i  =  0  ;i<n;i++)temp[i]=sourceString[i];  
    String  result  =  new  String(temp);  
    ---------------------------------------------------------------  
     
    JRun中设置contentType="text/html;charset=gb2312"  只能保证正常显示页面内容  
    而通过request.getParameter()方法得到的,和从数据库中读出的则显示乱码  
    这时候则需要进行内码转换
      

  3.   

    页面加上<%@page contentType="text/html; charset=gb2312" language="java" %>参数传递取某地址信息
    address=new String(request.getParameter("Address").getBytes("8859_1"));
    这样就可以取得中文了。
      

  4.   

    我就用jrun开发,很好用
    address=new String(request.getParameter("Address").getBytes("8859_1"));
    这样就可以了
      

  5.   

    我以前用过了,虽然写代码是好点,不过怎么用的不太习惯,现在还是在ultraedit写jsp,用jbuild写javabean