struts2 url传值中文乱码解决方案

HttpServletRequest request = ActionContext.getContext().get(
    org.apache.struts2.StrutsStatics.HTTP_REQUEST); String[] querys = request.getQueryString().split("&");
for (int i = 0; i < querys.length; i++) {
if (querys[i].indexOf("areastr") > -1) {
areastr = new String(querys[i].getBytes("iso-8859-1"), "gb2312").split("areastr=")[1];
}
}
System.out.println("areastr="+areastr);

 

你可能感兴趣的:(status,url)