in php I do this:
<?php
function displaySomething($list) {
foreach ($list as $item) {
?>
<html code here><?php echo $item["field"] ?><html code again etc>
<?php }
}
?>
And then I use it to display different lists in different places in my page.
Is there a way to achieve this with jsp? Create methods with parameters in which I can combine html with java?
<%! %> admits only java code, can't cut in with html code.