中文Url传递

打开tomcat/conf/servel.xml
修改(黑体字为修改部分)
<Connector port="8080" 
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 
               enableLookups="false" redirectPort="8443" acceptCount="100" 
               debug="0" connectionTimeout="20000" 
               disableUploadTimeout="true" URIEncoding="GBK"/> 


链接传递中文参数例子

<a href="DriverQuery.jsp?useCarPerson=<%=java.net.URLEncoder.encode("中文")%>"> 点击</a> 


String useCarPerson= new String(request.getParameter("useCarPerson").getBytes("ISO-8859-1")); //修改server.xml前 
useCarPerson = request.getParameter("useCarPerson");//修改server.xml后


你可能感兴趣的:(java,html,tomcat,xml)