如何在后台获取jsp页面中的多个name一样的其中的一个值?

Phil_Jing 2017-12-16 12:35:14
很多东西都写在一个页面了,从而出现了多个name一样的情况,我后台取值总是“,1”这种情况,其实我只想要1,本来我写在遍历正则去,的,奈何没想出理想的。后来想form提交的时候把重名的table给empty了,但是这样用户肯定会看到体验很不好。目前就8个name会出现的一样的,自己挖的坑自己想填了,拜托拜托了
...全文
466 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
什么都不能 2017-12-17
  • 打赏
  • 举报
回复
引用 3 楼 phil_jing 的回复:
[quote=引用 1 楼 hanpoyangtitan 的回复:] Talk is cheap, show me your code.
页面code在楼上,后台我只是用supplierInvestigationBeans这个bean去接受,因为会出现一样的isConfirm所以会有,参入; 这种name = "shareholders[0].name" 可以出现到shareholders[100].name,我这样去后台拿值的之后会出现大量的“,” ,现在不知道怎么做了[/quote] 为什么会有两个已阅读?虽然看似两个语言版本,但明显这样写不合理吧? <input type="checkbox" value="Y" name="supplierInvestigationBeans.isConfirm" <c:if test="${biz.supplierInvestigationBeans.isConfirm=='Y'}">checked</c:if> /> 已仔细阅读,同意并遵守/I agree to the certification above. 标红的部分应该是多语言的。<fmt:message> 解决
什么都不能 2017-12-16
  • 打赏
  • 举报
回复
Talk is cheap, show me your code.
Phil_Jing 2017-12-16
  • 打赏
  • 举报
回复
算了,结帖了
yaokaiwen_java 2017-12-16
  • 打赏
  • 举报
回复
String[] aaa=request.getParameters("xxx"); for(String s:aaa){ System.out.print(s); } 对吧
Phil_Jing 2017-12-16
  • 打赏
  • 举报
回复
引用 1 楼 hanpoyangtitan 的回复:
Talk is cheap, show me your code.
页面code在楼上,后台我只是用supplierInvestigationBeans这个bean去接受,因为会出现一样的isConfirm所以会有,参入; 这种name = "shareholders[0].name" 可以出现到shareholders[100].name,我这样去后台拿值的之后会出现大量的“,” ,现在不知道怎么做了
Phil_Jing 2017-12-16
  • 打赏
  • 举报
回复

<td class="title" width="25%"><span class="edit_supplier_red">*</span></td>
<td class="" width="95%" style="text-align:center;">
<input type="checkbox" value="Y"  name="supplierInvestigationBeans.isConfirm" <c:if test="${biz.supplierInvestigationBeans.isConfirm=='Y'}">checked</c:if> />
已仔细阅读,同意并遵守/I agree to the certification above.
                
<input type="checkbox" value="Y" <c:if test="${biz.supplierInvestigationBeans.isConfirm=='Y'}">checked</c:if> />
Already Read, Agree and Confirm.
</td>
类如此上代码,会出现两次为supplierInvestigationBeans.isConfirm的name

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧