This is index.jsp page:
<form method="post">
<select name="channel">
<option>Star Movie</option>
<option>HBO</option>
...
//More television channel option
</select>
<select name="channel">
<option>Star Movie</option>
<option>HBO</option>
...
//More television channel option
</select>
...
//More select input added dynamic by user
<button class="btn-add" >Add channel</button>
<input type="submit" value="Submit"/>
</form>
This is my Controller
@RequestMapping(value = "/channelReview", method = RequestMethod.POST)
ModelAndView actionChannelReview(@RequestParam("channel") String[] channelLst){
...
//Do something else
}
The problem here is why channelLst is only have 1 element and it always the last value of on the form, no matter how many user add on form.
I did not face any issue, i used the same code that you have mentioned, i got 2 channels in channelLst
I also added dynamic dropdowns, working fine with any number of dropdowns