servlet輸出中文亂碼(問號)解決

在get和post方法里加上以下代碼把request和response編碼格式改爲utf-8:

request.setCharacterEncoding(“utf-8”);
response.setContentType(“text/html;charset=utf-8”);
response.setCharacterEncoding(“utf-8”);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章