request,response,ssh中文乱码解决方案

(1)request中有常见的两种提交方式post,get提交解决中文乱码

        1.post提交--只要在前面加上:request.setCharacterEncoding("utf-8")

request,response,ssh中文乱码解决方案

        2.get提交----需要将获取的参数进行编码转换,

request,response,ssh中文乱码解决方案

(2) response解决中文乱码----response.setContentType("text/html;charset=UTF-8")

request,response,ssh中文乱码解决方案

(3) SSH中解决中文乱码----无论是get提交还是post提交只要在struts.xml中配置常量即可

request,response,ssh中文乱码解决方案

(4) 过滤器来解决中文乱码

   1.post提交,解决中文乱码

request,response,ssh中文乱码解决方案

2.get提交解决中文乱码----getParameter()方法增强 

request,response,ssh中文乱码解决方案