Jsp Html 实现下拉框和组合下拉框(1)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="html/css">
<!--
.STYLE1{
color:#FF0000;
font-size:large;
width:150px;
}
-->
</style>
</head>
<body>
<form name="form1" action="list.jsp" method="post">
<div>
<span type="submit" value="提交">
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h3>您选择的是:</h3>
<h2>
<font color="red">
<%
//设置request对象的字符编码集,避免中文显示的乱码
request.setCharacterEncoding("UTF-8");
//获取下拉列表框的值
String date=request.getParameter("select");
//如果设置了mutiple属性
//String[] date=request.getParameterValues("select");
out.println(date);
%>
</font>
</h2>
</body>
</html>