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