顯示具有 Tomcat 標籤的文章。 顯示所有文章
顯示具有 Tomcat 標籤的文章。 顯示所有文章

2013年8月22日 星期四

【轉貼】Tomcat與UTF-8編碼

由於Tomcat預設的編碼為ISO-8859-1,所以當使用Tomcat架設JSP與Mysql資料庫時
,便要注意中文編碼的問題。最好的方法就是把 Tomcat、web與Mysql全部的編碼一
律設定為UTF-8,下面將說明如何將Tomcat的編碼處理設定為UTF-8。

1. GET請求部份
Tomcat使用ISO-8859-1編碼作為預設的URL編碼,所以當web發出夾帶中文訊息的
get請求時,資料就會變成亂碼。

解決方法是修改\Tomcat\conf\server.xml檔案,找到Connector標籤,加入
URIEncoding="UTF-8"即可。
========
Connector port="8080" protocol="HTTP/1.1"
URIEncoding="UTF-8"
connectionTimeout="20000"
redirectPort="8443"
========= 

【FROM】http://roymercadian.blogspot.tw/2012/12/tomcatutf-8.html
【FROM】http://overinfinityresearch.blogspot.tw/2007/10/tomcat6-servletget.html

2013年7月6日 星期六

在Eclipse中讓Tomcat可以每次都更新靜態檔案如*.html..等

EclipseTomcat可以每次都更新靜態檔案如*.html..
不需要重新部屬...
第一種方法是在Tomcat啟動前加入參數
Disabling caching in Tapestry
It is troublesome to reload the application before each test run. To solve the first part of the problem, you can tell
Tapestry to not to cache HTML and .page files. To do that, you need to set a JVM system property
26 Chapter 1 Getting Started with Tapestry
org.apache.tapestry.disable-caching to true. If you were starting the JVM yourself, you would run it like:
java -Dorg.apache.tapestry.disable-caching=true...
However, as the JVM is started by Tomcat, you need to setup a environment variable JAVA_OPTS before running
startup.bat:
Now, you can change say Home.html and the change will take effect immediately.


第二種方法是在Eclipse的JVM中入參數 
for Tomcat plugin
將上方紅色的那一行加進 JVA 的參數中,下圖中的另外三行是設定記憶體大小

for eclipse server plugin

資料來源:EnjoyWebDevWithTapestry


Related Posts Plugin for WordPress, Blogger...