jsp亂碼的解決心得及方案
解決問題?(jsp之間中文漢字的傳輸的亂碼)
解決方法:
1 在第一個jsp界面中
function getSelectArgueReason(sign){
//進行代碼轉碼
var test = encodeURI(sign);
var task_argue_win_2=$("#task_argue_win_2");
task_argue_win_2.window({href:""});
task_argue_win_2.window('refresh');
task_argue_win_2.window({href:'hblims/statistics/statistics-ywk-task-accept-list.jsp?status=arguereason&sign='+test});
task_argue_win_2.window('open');
}
2 在第二個jsp 界面中取得值并向后臺action傳值
//再次進行編碼
url:'hblims/statistics/StatisticsTaskAction!getTaskCount.action?tsk_type='+encodeURI('${param.sign}'),
3 后臺action中取得值
String tsk_type=request.getParameter("tsk_type");
//利用spring下的StringEscapeUtils類進行解碼
tsk_type=StringEscapeUtils.unescapeHtml(tsktype)