在jsp程序中设置:
<%@ page contentType="text/html; charset=ISO8859_1" %>同时设置页面的<meta/>如下:
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">

解决方案 »

  1.   

    <%@ page contentType="text/html; charset=gb2312" %>

    <%@ page contentType="text/html; charset=ISO8859_1" %>
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
    的区别是什么?
      

  2.   

    <%@ page contentType="text/html; charset=ISO8859_1" %>这句写在jsp程序中
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">这是在html文件嵌套在<head></head>标签中你可以这样写你的jsp程序:test.jsp<%@ page contentType="text/html; charset=ISO8859_1" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
    </head><body>
    i love you!<br>
    我爱你<br>
    <%
    out.println("我也爱你!");
    %>
    </body></html>
    试试看,肯定不会有乱码!
      

  3.   

    一个页面   a.jsp
    编译后-->  a_jsp.java 
    ----------------------------
    上面的话有些不懂哦这是JBuilder生成的JSP页面编码设置
    <%@ page contentType="text/html; charset=GBK" %>
    楼主不妨参考参考
    另:<meta http-equiv="Content-Type" content="text/html;charset=gb2312">是html文件中对简体中文的编码设置
      

  4.   

    <%@ page contentType="text/html; charset=ISO8859_1" %>这句表示jsp文件被转换成.java后的字符编码方式为ISO8859_1<meta http-equiv="Content-Type" content="text/html;charset=gb2312">这句就是浏览器用中文gb2312的方式查看网页
    相当于在IE的菜单:查看>>编码>>中文编码(GB2312)
      

  5.   

    拭完了!okthanks虽然没有说明白区别,
    而且例子中的话那么肉麻,还是要给分!