close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": libsvn_subr-1.so.1: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of waue/2011/1018


Ignore:
Timestamp:
Oct 18, 2011, 4:04:17 PM (13 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2011/1018

    v3 v4  
     1{{{
     2#!html
     3<div style="text-align: center; color:#151B8D"><big style="font-weight: bold;"><big><big>
     4Eclipse Tomcat Utf8 bug
     5</big></big></big></div> <div style="text-align: center; color:#7E2217"><big style="font-weight: bold;"><big>
    16eclipse + tomcat + jsp
    2 
    3 問題: 獨立使用 tomcat 開啟的 jsp ,在網頁和網頁之間傳遞參數沒有問題;但是用 eclipse 開啟 tomcat server ,在網址傳遞到網頁端則出現亂碼
    4 
    5 將 eclipse 環境設定為 UTF-8 的方法
     7</big></big></div>
     8}}}
     9[[PageOutline]]
    610
    711
    8 = 1. =
    9 windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Workspace,右側Text file encoding,選擇Other,改變為UTF-8,以後新建立工程其屬性對話框中的Text file encoding即為UTF-8。
     12= 問題 =
     13獨立使用 tomcat 開啟的 jsp ,在網頁和網頁之間傳遞參數沒有問題
     14[[Image(2.jpg,width=600)]]
    1015
    11 = 2. =
    12 windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Content Types,右側Context Types樹,點開Text中每一顆子項,並在中輸入"UTF-8",點update!
     16但是用 eclipse 開啟 tomcat server ,在網址傳遞到網頁端則出現亂碼
     17[[Image(1.jpg,width=600)]]
    1318
    14 = 3. =
    15 Servers -> TomcatXXXX-config : server.xml 
     19以下列出 eclipse 環境設定為 UTF-8 的方法
     20
     21= 解法 =
     22== 1. eclipse 環境設定 ==
     23 * Text file encoding
     24
     25windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Workspace,
     26
     27右側Text file encoding,選擇Other,改變為UTF-8,以後新建立工程其屬性對話框中的Text file encoding即為UTF-8。
     28
     29 * Context Types
     30
     31windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Content Types,
     32
     33右側Context Types樹,點開Text中每一顆子項,並在中輸入"UTF-8",點update!
     34
     35== 3. 檢查 server.xml 的設定==
     36左側專案樹 -> Servers -> TomcatXXXX-config : server.xml 
    1637{{{
    1738    <Connector port="7080" protocol="HTTP/1.1"