cjmiou 发表于 2013-1-26 15:40:19

怎样把一个数组用URL传到本页面???

<div class="g_w_100" style="overflow: hidden;">       <div class="g_t_left c07 content"><span style="border-collapse: collapse; color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: left; text-indent: 0px; white-space: normal;">怎样把一个数组用URL传到本页面???

<div style="font-size: 14px; line-height: 1.6em;">《productsearchsimple.jsp页面的代码》
<div class="highlighter">
[*]<%
[*]StringstrCategoryId[]=request.getParameterValues("categoryid");  //此处是从另一个页面中的checkbox传过来的
[*]Stringkeyword=request.getParameter("keyword");
[*]StringstrPageNo=request.getParameter("pageNo");
[*]intpageNo=1;
[*]if(strPageNo!=null&&strPageNo.trim().equals(""))
[*]{
[*]pageNo=Integer.parseInt("strPageNO");
[*]}
[*]int[]ArrayCategoryId;
[*]if(strCategoryId==null||strCategoryId.length==0)
[*]{
[*]ArrayCategoryId=null;
[*]}
[*]else
[*]{
[*]ArrayCategoryId=newint;
[*]for(inti=0;i<strCategoryId.length;i++)
[*]{
[*]ArrayCategoryId=Integer.parseInt(strCategoryId);
[*]}
[*]}
[*]List<Product>products=newArrayList<Product>();
[*]intpageCount=ProductMgr.getInstance().findProducts(products,ArrayCategoryId,keyword,-1,-1,-1,-1,null,null,pageNo,5);
[*]//out.println(list.size());
[*]//response.sendRedirect("showproductsearch.jsp?List=list");
[*]%>
[*]<center>搜索结果</center>
[*]<tableborder="1"align="center">
[*]<tr>
[*]<td>
[*]ID
[*]</td>
[*]<td>
[*]名称
[*]</td>
[*]<td>
[*]描述
[*]</td>
[*]<td>
[*]会员价格
[*]</td>
[*]<td>
[*]市场价格
[*]</td>
[*]<td>
[*]进货日期
[*]</td>
[*]<td>
[*]类别ID
[*]</td>
[*]<td>
[*]删除
[*]</td>
[*]<td>
[*]修改
[*]</td>
[*]</tr>
[*]<%
[*]//List<Product>productes=ProductMgr.getInstance().getProducts(pageNo,PAGE_SIZE);
[*]
[*]for(Iterator<Product>it=products.iterator();it.hasNext();)
[*]{
[*]Productc=it.next();
[*]%>
[*]<tr>
[*]<td><%=c.getId()%></td>
[*]<td><%=c.getName()%></td>
[*]<td><%=c.getDescr()%></td>
[*]<td><%=c.getMemberPrice()%></td>
[*]<td><%=c.getNormalPrice()%></td>
[*]<td><%=c.getPdate()%></td>
[*]<td><%=c.getCategory()%></td>
[*]<td>
[*]<ahref="productdelete.jsp?id=<%=c.getId()%>">删除</a>
[*]</td>
[*]<td>
[*]<ahref="productmodify.jsp?id=<%=c.getId()%>">修改</a>
[*]</td>
[*]</tr>
[*]<%
[*]}
[*]%>
[*]</table>
[*]<center>
[*]共<%=pageCount%>页
[*]<ahref="productsearchsimple.jsp?pageno=<%=pageNo-1%>">上一页</a><%=pageNo%>
[*]<%
[*]if(pageNo<pageCount)
[*]{
[*]//System.out.println("search==="+search);
[*]//System.out.println("pageNo==="+pageNo);
[*]//System.out.println("pageCount==="+pageCount);
[*]%>
[*]<ahref="productsearchsimple.jsp?pageno=<%=pageNo+1%>&categoryid=<%=ArrayCategoryId%>&keyword=<%=keyword%>">下一页</a>
[*]<%}%>
[*]<ahref="productsearchsimple.jsp?<%=pageCount%>">最后一页</a>
[*]</center>
页: [1]
查看完整版本: 怎样把一个数组用URL传到本页面???