<form action="" method="post">
<table border="1" cellspacing="" cellpadding="">
<tr><td align="center" colspan="2">用户注册页面</td></tr>
<tr><td>用户名:</td><td><input type="text" size="29"></td></tr>
<tr><td>密码:</td><td><input type="password" size="30"></td></tr>
<tr><td align="center" colspan="2"><input type="button" value="确定" size="10"></td></tr>
<tr><td>性别:</td><td><input type="radio" name="sex" value="男">男 <input type="radio" name="sex" value="女">女</td></tr>
<tr><td>爱好:</td><td><input type="checkbox" name="wan" value="wanyouxi">玩游戏
<input type="checkbox" name="chidxi" value="chidix">吃东西
<input type="checkbox" name="shuijiao value="sj">睡觉
</td></tr>
<tr><td>家庭住址:</td><td><select name="address">
<option value="山西">山西</option>
<option value="黑龙江">黑龙江</option>
<option value="四川">北京</option>
</select>
<select name="市">
<option value="朔州市">朔州市</option>
<option value="哈尔滨">哈尔滨</option>
<option value="成都市">成都</option>
</select>
<select name="区">
<option value="朔城区">朔城区</option>
<option value="江北">江北</option>
<option value="家乡">家乡</option>
</select>
</td></tr>
<tr><td colspan="2">上传文件:<input type="file"></td></tr>
<tr><td align="center">其他:</td><td><textarea rows="10" cols="30">
</textarea></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="提交"></td></tr>
</table>
</form>
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UserInfo people = new UserInfo();
request.setCharacterEncoding("utf-8");
response.setContentType("text/html; charset=gb2312");
people.setUsername(request.getParameter("username"));
people.setPassword(request.getParameter("password"));
people.setSex(request.getParameter("sex"));
String habbString[] = request.getParameterValues("hobby");
String aihaoString="";
if(habbString!=null)
for(int i=0;i<habbString.length;i++)
aihaoString += habbString[i]+",";
people.setHobby(aihaoString);
people.setAddress(request.getParameter("address")+request.getParameter("shi")+request.getParameter("shi"));
people.setMeno(request.getParameter("meno"));
InforService caozuo = new InforService();
System.out.println("建立InforService对象");
caozuo.insert(people);
}