{{{ #!html
Eclipse Tomcat Utf8 bug
eclipse + tomcat + jsp
}}} [[PageOutline]] = 問題 = * 獨立使用 tomcat 開啟的 jsp ,在網頁和網頁之間傳遞參數沒有問題 [[Image(2.png,width=600)]] * 但是用 eclipse 開啟 tomcat server ,在網址傳遞到網頁端則出現亂碼 [[Image(1.png,width=600)]] 以下列出 eclipse 環境設定為 UTF-8 的方法 = 解法 = == 1. eclipse 環境設定 == * Text file encoding windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Workspace, 右側Text file encoding,選擇Other,改變為UTF-8,以後新建立工程其屬性對話框中的Text file encoding即為UTF-8。 * Context Types windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Content Types, 右側Context Types樹,點開Text中每一顆子項,並在中輸入"UTF-8",點update! == 3. 檢查 server.xml 的設定 == 左側專案樹 -> Servers -> TomcatXXXX-config : server.xml {{{ #!text }}} 這邊的選項是在eclipse 建立 tomcat 時就已經載入了,因此即使之後在改 原始目錄的 server.xml 也不會對應到 eclipse ,因此可以到專案內修改。