I have an index file and a servlet class file. I need to create a table after i submit information from the index to the servlet class. I submit the form.
<form name="form" method="post" action="servlet">
Number: <input type="number" name="table"/>
<input type="submit" value="Submit"/>
</form>
This information is passed to the servlet as a number. I need to make tables with the number. If it is 1, it is 1 row, if iti s 5 it is 5 rows. I need to use a for loop on the servlet page, but i am stuck. I have tried something like below, but it does not work.
<table>
<% for(int row=1; row <= 5; row++) { %>
<tr>
</tr>
<% } %>
</table>