ajax/表单提交 多个相同name的处理方法

场景

提交table,如多行数据,有多个相同的name

  1. form提交
<form method="post" action="/jh4j/aa/list">
	<input type="text" name="account" />
	<input type="text" name="account" />
	<input type="submit" value="提交">
</form>

<form method="get" action="/jh4j/aa/list">
	<input type="text" name="account" />
	<input type="text" name="account" />
	<input type="submit" value="提交">
</form>

后台接收:

String account;
String[] arr = org.springframework.util.StringUtils.split(account, ","); // spring的split符合该场景

account-> ","

posted @ 2020-09-21 10:16  fight139  阅读(686)  评论(0编辑  收藏  举报