jsp中文顯示問號問題解決方法

字號:


    jsp中想要輸出的中文被顯示成問號?在eclipse-windows- preferences中搜索jsp,encoding選項中選擇 chinese,此問題便可解決
    問題: jsp中想要輸出的中文被顯示成“?”
    解決方法 : 在eclipse-windows- preferences中 搜索jsp , encoding選項中選擇 chinese 。 這樣新建的jsp文件將支持中文顯示。
    對已經存在的jsp文件做如下修改: 將各種編碼方式都改成gb18030,如下:
    代碼如下:
    <%@ page language=java contenttype=text/html; charset=gb18030
    pageencoding=gb18030%>
    <!doctype html public -//w3c//dtd html 4.01 transitional//en >
    <html>
    <head>
    <meta http-equiv=content-type content=text/html; charset=gb18030>
    <title>hello</title>
    </head>
    <body>
    你好
    </body>
    </html>
    則“你好”可正確顯示