I have a JSP that shows a table of data retrieved from a derby database via servlets and I would like to use Spring to create a real time search bar that updates the table based on keypress. I would usually use JavaScript for this but our professor strictly told us to use MVC Framework using JSP and Servlets and Spring.
This is my code for the table container I would like to have a search bar with.
It uses jsp scriplets in order to retrieve data from the servlet context and uses said data to generate a bunch of table rows.
<div class="table-container">
<input type="text" id="search">
<table>
<thead>
<tr>
<th>Product ID</th>
<th>Product Name</th>
<th>Series</th>
<th>Price</th>
</tr>
</thead>
<%
List<Product> products = (List<Product>) getServletContext().getAttribute("productList");
for (Product product : products) {
%>
<tbody
<tr>
<td><%=product.getProductId()%></td>
<td><%=product.getName()%></td>
<td><%=product.getSeries().substring(0, 1).toUpperCase() + product.getSeries().substring(1)%></td>
<td><%=product.getPrice()%></td>
</tr>
</tbody>
<%
}
%>
</table>
</div>