为什么form表单里的中文是乱码
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page contentType="text/html;charset=gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>
     <base href="<%=basePath%>">      
     <title>My JSP 'add.jsp' starting page</title>
     <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">     
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
   </head>    
   <body>
   <center>
     用户注册<br>
     <form action="/spring_ssh/register.do" method="get">
     	<table>
     		<tr>
     			<td>
     				用户名:
     			</td>
     			<td>
     				<input type="text" name="userName"/>
     			</td>
     		</tr>
     		<tr>
     			<td>
     				年龄:
     			</td>
     			<td>
     				<input type="text" name="age"/>
     			</td>
     		</tr>
     		<tr>
     			<td>
     				<input type="submit" value="注册">
     			</td>
     			<td>
     				<input type="reset" value="清空">
     			</td>
     		</tr>
     	</table>
     </form>
     </center>
     <%  
            out.print("JSP的中文处理,测试");  
     %>
   </body>
</html>
-----------------------
为什么我在用户名里输入中文,提交到后台,显示的是问号(后台程序有System.out.println(request.getParameter("userName"));),而 out.print("JSP的中文处理,测试");  这句能正常显示呢?
------解决方案--------------------后台也加上
request.setCharacterEncoding("gb2312");
------解决方案--------------------产生乱码主要是要看两端编码/解码问题还跟网络传输有关系
一般post提交:
开始用<%request.setCharacterEncoding("gb2312");%>就能正确显示中文
普通get提交:
提交参数假如是userName
要用String userName = request.getParameter("userName");
new String(userName.getBytes("iso8859-1"),"gb2312");
才能正确解码提交来的参数
本页要正确显示中文开始编码要用charset="gb2312"
同时del.jsp开始也设置成charset="gb2312"
一楼回答的是如果用url传参数的时候
用URLEncoder.encode(参数,"编码");
数据库编码安装时就决定了
数据库安装时最好使用gbk编码,
oracle,mysql安装时都可以选择,否则读取数据很麻烦,需要转码才能正确显示
URL中文参数传输的问题出现乱码
解决办法 
 1)   打开tomcat的server.xml文件,找到区块,加入如下一行: 
 URIEncoding=”GBK” 
 完整的应如下:    
 <Connector   port="8080"     maxThreads="15