日期:2014-05-18  浏览次数:20635 次

jsp form传递中文出现乱码问题,只有10分了!
我通过form传递中文信息,接收页面显示的都是??,我用的方法是POST,tomcat版本是4.1。按照从网上看到的方法,在server.xml添加关于URL编码的信息,我添加了gb2312和iso8859-1都不对,还是显示乱码,请问怎么处理!

<Connector          
    port= "8080 "                                                               maxThreads= "150 "       minSpareThreads= "25 "       maxSpareThreads= "75 "      
                                                                enableLookups= "false "       redirectPort= "8443 "       acceptCount= "100 "      
                                                                debug= "0 "       connectionTimeout= "20000 "          
                                                                disableUploadTimeout= "true "       URIEncoding= "gb2312 "/>      
       
    和      
    <Connector       port= "8009 "          
                                                                enableLookups= "false "       redirectPort= "8443 "       debug= "0 "      
                                                                protocol= "AJP/1.3 "       URIEncoding= "gb2312 "/>      


------解决方案--------------------
在你的JSP源码中写一句request.setCharacterEncoding( "gb2312 ");