Have JSP page with dynamically generated HTML table with unknown number of rows.
Have property on backend, that sets maximum number of rows, e.g: max_rows=15
Put your table in a div block and use CSS to specify the height and overflow property of the div.
...table content...
This way the div has a fixed height and the browser will add a scrollbar when the content of the div block is too height.
I have set the height to 15em, which corresponds with 15 * font-height. When using borders, paddings and stuff this height is incorrect. But it can be calculated more properly (in px) for your design.