request.getParameterValues 当要获取多个同名参数时用request.getParameter获取单个参数这样用request.getParameterValues
String names[] = request.getParameterValues("names");
for(int i=0;i<names.length;i++){
out.println(names[i]);
}
String names[] = request.getParameterValues("names");
for(int i=0;i<names.length;i++){
out.println(names[i]);
}
解决方案 »
- struts1 中Action需要向页面传递对象的问题
- 严重: Servlet.service() for servlet jsp threw exception
- hibernate能为外键设置默认值吗?
- jsp装扮博客怎么实现? 有源代码吗?
- 菜鸟请教个技术问题,大侠请进~谢谢
- 类似QQ的同名用户登录问题
- 再发数据库连接的问题,请高手进来帮忙
- 一个无法解决的问题,jsp 高手请进!!
- 如何用jsp连接远程的Access数据库.跪求。
- 各位大哥帮忙看看,我的tomcat总是死,是不是我的数据炉连接没有关号呀
- 在一个页面中如何判断从上一页面传来的值是否为空的?
- 怎样在jsp页面调用到bean中的vector,就是吧vector的值传给页面
request.getParameter()得到的是个字串.
Enumeration e = (Enumeration)request.getParameterValues("name");
if (e.hasMoreElements())………………或:
String s = (String)request.getParameter("name");
if (s.equals(""))……………………