I know that I can get a parameter like:
HTML
<input type="text" name="field" value="test">
Servlet
String field = request.getParameter("field");
But what if I have multiple input with same name like:
HTML
<input type="text" name="line[]" value="test1">
<input type="text" name="line[]" value="test2">
<input type="text" name="line[]" value="test3">
In PHP I can just use name="line[]"
to get an array of all the line inputs. But how to go about this in java?
Servlet pseudo code
String[] lines = request.getParameterArray("line");
for(String line : lines){
//do shit
}
[]
suffix convention: stackoverflow.com/a/3061292