String[ ] hobbys = request.getParameterValues("hobby");
if(hobbys != null)
{
out.println("您的爱好有:");
for(int i=0;i<hobbys.length;i++)
out.println(hobbys[i]);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>个人信息注册</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> </head> <body> <h1 align="center">个人信息注册</h1> <form action="zhuce.jsp" method="post"> 姓名:<input type="text" name="name"><br> 密码:<input type="password" name="pwd"><br> 请选择你的职业: <input type="radio" name="career" value="农民">农民 <input type="radio" name="career" value="工人">工人 <input type="radio" name="career" value="学生" checked>学生 <input type="radio" name="career" value="教师">教师 <br> 你喜欢的城市: <select name="city"> <option value="辽宁省">辽宁省</option> <option value="湖北省">湖北省</option> <option value="河南省">河南省</option> <option value="山东省">山东省</option> <option value="江苏省">江苏省</option> <option value="湖南省" selected>湖南省</option> </select> <br> 请选择你的爱好: <input type="checkbox" name="hobby" value="旅游">旅游 <input type="checkbox" name="hobby" value="看书" checked>看书 <input type="checkbox" name="hobby" value="游戏">游戏 <input type="checkbox" name="hobby" value="琴棋书画">琴棋书画 <br> 自我介绍: <textarea name="intro">自我介绍</textarea> <br> <input type="submit" name="submit" value="提交"> </form> </body> </html>
<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8"%>
<%
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>个人信息注册</title>
<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>
<%request.setCharacterEncoding("UTF-8"); %>
您的姓名是:<%=request.getParameter("name") %><br>
您的密码是:<%=request.getParameter("pwd") %><br>
您的职业是:<%=request.getParameter("career") %><br>
您喜欢的城市是:<%=request.getParameter("city") %><br>
您的爱好有:<%String[] hobbys = request.getParameterValues("hobby");
if(hobbys != null)
{
out.println("您的爱好有:");
for(int i=0;i<hobbys.length;i++)
out.print(hobbys[i]);
}
%>
<br>
自我介绍:<%=request.getParameter("intro") %><br>
</body>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有