在第一行加入
<%@ page contentType="text/html; charset=gb2312" language="java"  errorPage="" %>

解决方案 »

  1.   

    <%@ page contentType="text/html; charset=gb2312" language="java" %>
    把它加上就行了!
      

  2.   

    对咯,我装的JSP的web引擎为RESIN(resin-2.1.14)
      

  3.   

    不行啊!
    这样:
    <%!
    String strtochin(String str)
    {
      byte[] byte1=str.getBytes();
      String temp="";
      try
      {
         temp=new String(byte1,"iso-8859-1");
      }
      catch(Exception e){
      }
       return temp;
    }
    %>加上它;并且将String title = "Hello, world!这是我改的第一个JSP程序";
    写为:String title = "Hello, world!这是我改的第一个JSP程序";
          title=strtochin(title);试试!希望行!!
      

  4.   

    还是不行
    <%@ page contentType="text/html; charset=gb2312" language="java"  errorPage="" %>
    <%
    //
    // Scripts between the scriptlet tags are simply executed.
    //
    String title = "Hello, world!这是我改的第一个JSP程序";
     title=strtochin(title);
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><!-- The expression tags interpolate script variables into the HTML --><title><%= title %></title>
    </head><body bgcolor=white><h1><%= title %></h1></body>
    <%!
    String strtochin(String str)
    {
      byte[] byte1=str.getBytes();
      String temp="";
      try
      {
         temp=new String(byte1,"iso-8859-1");
      }
      catch(Exception e){
      }
       return temp;
    }
    %>
      

  5.   

    <%@ page contentType="text/html; charset=gb2312" language="java"  errorPage="" %>
    你加了这个以后就不要再多此一举的来title=strtochin(title);这个转换了。
      

  6.   

    <%@ page contentType="text/html; charset=gb2312" language="java"%>
    <%
    String title = "Hello, world!这是我改的第一个JSP程序";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title><%=title%></title>
    </head><body bgcolor=white><h1><%=title%></h1></body>
    不好意思!
    这样就行了!
    不用去转换!