Configuring Tomcat's URI encoding

posted on 09 Dec 2008 18:34 by sonicneo  in J2ee

โดยปกติแล้ว Tomcat จะใช้ encoding เป็น  ISO-8859-1 ทุกๆึครั้งที่รับค่ามาจาก  Browser  มันก็จะเกิดปัญหา  เช่นไม่สามารถใช้ภาษาไทยได้ ทั้งๆที่เรา encoding เป็น utf-8 หรือ tis-620 เรียบร้อยแล้วนี่นา

 ปัญหานี้มีทางออก  โดยใช้ encoding เป็น UTF-8 เพราะมัน support ทุกภาษา  

1. แก้ไขไฟล์ conf/server.xml หาคำว่า 

<Connector port="8080"/>

2.เพิ่ม URIEncoding="UTF-8"

<Connector port="8080" URIEncoding="UTF-8"/> 
 

3.Restart Tomcat

edit @ 9 Dec 2008 18:46:12 by sonicneo

Comment



smilebig smileopen-mounthed smileconfused smilesad smileangry smiletonguequestionembarrassedsurprised smilewinkdouble winkcry

Tweet

ทำตามเเล้วครับเต่ไม่เห็นจะได้เลย
หรือว่ามีตรงอื่นอีกครับ งงมากๆ

#1 By chelsea13 (118.173.75.84) on 2008-12-10 20:03

ขอบคุณค่ะ

#2 By โหลดเพลง (124.157.236.176) on 2009-10-06 20:01

Que se ra

#3 By scratch and dent (124.157.236.175) on 2009-11-13 20:09

hi all !!

#4 By sears parts (124.157.191.197) on 2009-12-04 13:41