通过我们post请求的中文参数,不用考虑乱码问题;
但是get方式提交的中文,后台处理的时候出现乱码问题,
解决方案:确定系统使用的编码格式,然后判断请求的方法是不是get
例:String applyMethod = getRequest().getMethod();
if(null != searchKey){
//get请求转换搜索的中文,防止出现乱码问题
if(applyMethod.equalsIgnoreCase("get")){
searchKey = new String(searchKey.getBytes("iso-8859-1"),Const.UTF8_CODE);////确定自己系统的编码格式,修改为自己系统的编码
}
}