Try this:
<%@ page contentType="text/html; charset=ISO8859_1" %>

解决方案 »

  1.   

    还有你后面的jsp里面输出字符串的时候又没有什么转字符集的,字符集很烦人
      

  2.   

    我已经尝试过用GBK,ISO8859-1.
    我在以前的weblogic6.0上也是可以用的,在同事的机器上,一样的配置,一样的代码也是可以跑的。字符集转的过程中也应当没有问题。
    哪位遇到过类似的问题。在weblogic中有没有专门的设置项用于对字符集进行设置的?
    google上可惜没有中文的讨论组。
      

  3.   

    jsp中加上
    <%@ page contentType="text/html;charset=gb2312" %>在利用这个函数:
    <!--转换中文字符的方法-->
    <%!
       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";
       }
    %>
      

  4.   

    不是,都转过了,在JSP中输出打印后可以证明转换已经成功,而且这种乱码的出现是毫无规律的。同样的页面,在多次操作后,出现正常或者乱码的反复。所有的缓存都清空了。同样的代码,在另外一台机器上运行的很好。真是找不到原因。
      

  5.   

    今天继续这个问题,我在频繁刷新我的登陆修改密码的页面时,页面出现了时好时坏的乱码问题,后台同步打印了如下的错误提示信息:
    <2002-8-20 上午10时27分30秒> <Error> <HTTP> <Connection failure
    java.net.SocketException: ReadFile failed: ??¨??????????????á?
     (error 64, fd 2104)
    at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
    at weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java:407)
    at weblogic.servlet.internal.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java:231)
    at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:977)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1964)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    > 我在google的讨论组上看了一些帖子。暂时还没有找到和我的问题比较相像的。
    哪位遇到过呀?
    我得运行环境:windows2000 advanced server,p41.7G,512M DDR,数据库sqlserver7.0(oracle8.0.5).用jb7&weblogic6.1开发。
    急呀!!
      

  6.   

    这是两年前google上一个开发人员遇到的问题:
    Recently we encounter the problem when we press the "Refresh" button(Browser MS IE) so quickly then WLS shows the error message as below: (The scenario is calling an entity  bean from JSP.)******************************************************GMT+08:00 2000:<E> <HTTP>
    Connection failure
    java.net.SocketException: ReadFile on fd=916 failed with err=64
    at weblogic.socket.NTSocketMuxer.initiateIO(Native Method)
     at
    weblogic.socket.NTSocketMuxer.read(NTSocketMuxer.java,
    Compiled Code)
     at
    weblogic.socket.MuxableSocketHTTP.requeue(MuxableSocketHTTP.java,
    Compiled Code)
     at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
    Compiled Code)
     at
    weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
    Compiled Code)
    ******************************************************
      
       Basicly it's not hurt for our application, but we
    usually need to convert the encoding of the string
    selected from Database in the EJB(it mean I need to
    convert the String because we need chinese). But if we
    press the "Refresh" button so quickly, the chinese is
    incorrect and appeared as "???????". And if we press
    the button later and slowly then the chinese is
    correct.
       Can someone give me some clue about that ? Or is it related with the "Performance Pack" of WLS...?下面是一个weblogic开发者的回答:
    This is a harmless error which means that the client has closed the socket
    without telling the server.  In this case it looks like a keep-alive HTTP
    socket.  The server has processed one request and is attempting to read
    another when it gets this error.  Since this is an NT specific exception we
    were reporting it as a "true" problem rathern than just squelching it.  I
    believe that later service packs against 5.1 do squelch this so that your
    logs don't get filled with these messages.现在我应当怎么办呀?
      

  7.   

    你可以调用函数处理啊,这样不就可以了吗,给你一个函数,在需要的地方调用就可以了。
    public static String UnicodeToChinese(String s){
      try{
         String newstring=null;
         newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
         return newstring;
        }
      catch(UnsupportedEncodingException e)
      {
      return s;
      }
      }