JSTL通過URL傳中文亂碼${param.cname}

url***********?cname=中文

跳轉到url所指的頁面通過${param.cname},中文變成亂碼。

解決方案:<% String x=request.getParameter("cname");x=new String(x.getBytes("iso-8859-1"),"utf-8");out.print(x);%>

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