posts - 89, comments - 241, trackbacks - 0, articles - 1
   :: 首页 ::  :: 联系 :: 聚合  :: 管理

JSP---request方法

Posted on 2009-02-26 14:31 saobaolu 阅读(630) 评论(0)  编辑  收藏 所属分类: javaweb
 1<form name = "form1" method = "post" action = "doit.jsp">
 2//所有的表单程序必须写在form表单里
 3<input type = "checkbox" name = "color" value = "color"红色>
 4<input type = "checkbox" name = "color" value = "green"绿色>
 5<input type = "checkbox" name = "color" value = "yellow"黄色>
 6</form>
 7
 8
 9
10doit.jsp
11<%@ page contentType = "text/html";Charset = GBK; %>
12<%
13String color[] = request.getParameterValues("color");
14for(int i = 0;i<=color.length-1;i++){
15out.println("color"+color[i]+" ");
16}

17%>
18//request.getParameterValues("color")需要用数组来接收  


没有所谓的命运,只有不同的选择!