- JSP pageEncoding
- contentType in http header and html
- response.setCharacterEncoding
- request.setCharacterEncoding
- useBodyEncodingForURI
- URIEncoding
為了做最後一到防線,讓以後碰到編碼問題不必東改西改,我設計一個fetch method來解決GET/POST編碼問題。
pseduo code
class ServletHelper {
method fetch ( name, defaultValue ) {
if request.getParameter( name ) not exists {
return defaultValue
}
if request.characterEncoding is UTF-8 {
return request.getParameter( name ) as UTF-8
}
else {
return request.getParameter( name )
}
}
}
唉呀呀~~~身為頭號粉絲的我,居然沒注意到你已經update了好多篇新文章呀!
回覆刪除but~~~底圖怎不是你的英姿呀!?
倒是最下方偷偷掛上思創的名稱了唷! Good !!!
原來是你都沒來光顧,難怪最近流量掉了一半: ) 我還沒有足夠時間去改版面哩,暫時先這樣用一陣子。
回覆刪除